ZTIMER(1)

2024-11-03

NAME

ztimer - command-line timer

SYNOPSIS

ztimer [-c duration] [-t duration] [-qsV]

DESCRIPTION

ztimer is a command-line timer that can act as a timer, countdown or stopwatch. When running as a stopwatch, the time displayed simply counts up. When running in timer mode, the program still counts up but ends after the specified duration. In countdown mode, the remaining time (from the specified time) is displayed.

The options are as follows:

-c duration

Run in countdown mode and set the corresponding duration. See below for the duration format.

-h

Print a short usage string and exit.

-q

Exit with code 0 instead of 1 when pressing 'q'.

-s

Run in stopwatch mode.

-t duration

Run in timer mode and set the corresponding duration. See below for the duration format.

-V

Print the version information and exit.

The duration for countdown and timer mode is given as a sequence of a number and a unit. This pattern can repeat. Hours (h), minutes (m), seconds (s) and milliseconds (ms) are supported. For example, one hour and 30 minutes are represented as "1h30m". A unit may appear multiple times, in which case their values are summed up. The order of the units is not important.

While the program is running, the following keys can be pressed:

<newline>

Continue to display the current time in a new line and leave a copy of the current time above.

<space>

Pause/resume the timer.

q

Exit the program.

EXIT STATUS

ztimer exits with 0 if no error occurs. Otherwise, the exit code is 1. When the timer is ended prematurely with 'q', the exit code is also 1 except for when the '-q' option is present.

AUTHORS

Created and maintained by Hannes Braun <hannes@hannesbraun.net>. Up-to-date sources can be found at https://git.sr.ht/~hannes/ztimer. Bugs and patches can be submitted by email to ~hannes/public-inbox@lists.sr.ht.