TerminalClock.jl

TerminalClock displays a clock, stopwatch, or countdown using large character dials in a terminal. It supports Julia 1.10 and the latest stable release, with automated tests on Linux, macOS, and Windows.

Install

In the Julia package REPL (press ]):

pkg> add TerminalClock

Or use:

using Pkg
Pkg.add("TerminalClock")

The latest development documentation describes main. A registry release may not yet include these changes. To install the development version explicitly:

Pkg.add(url="https://github.com/AtelierArith/TerminalClock.jl", rev="main")

Start a display

Run one of these commands in a terminal Julia REPL. Each command occupies the REPL while it is running.

CommandDisplayStop
clock()Current local time, HH:MM:SSCtrl+C
stopwatch()Elapsed time, MM:SS:mmmCtrl+C
countdown(minute=10)Remaining time, HH:MM:SSZero, or Ctrl+C
using TerminalClock

clock()                 # Current local time
stopwatch()             # 10 ms refresh interval
countdown(minute=10)    # Ten-minute timer

Execute one display at a time. These examples are intentionally not executed by the documentation builder: the clock and stopwatch run until interrupted.

Render a single frame

The Time/DateTime clock methods and the Time stopwatch method return a string. They do not start a live timer.

using TerminalClock, Dates
print(clock(Time(12, 34, 56)))
        + +-------+           +-------+ +       +           +-------+ +-------+
        |         |                   | |       |           |         |
        |         |     ⊗             | |       |     ⊗     |         |
        |         |                   | |       |           |         |
        + +-------+           +-------+ +-------+           +-------+ +-------+
        | |                           |         |                   | |       |
        | |             ⊗             |         |     ⊗             | |       |
        | |                           |         |                   | |       |
        + +-------+           +-------+         +           +-------+ +-------+

Use these methods to include a frame in your own output. See Using the clocks for details.

Where to go next

The source and issue tracker are on GitHub.