ThiBsc / stopwatch

A command line stopwatch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stopwatch

Build Status AUR-GIT License: MIT
A command line stopwatch
00:00:07.235

Compile

make
# Install
mv ./bin/sw /usr/bin
# Display help
sw --help

Use

Foreground and background color

# Start a stopwatch
sw
# Start a countdown (hh:mm:ss)
sw -c 00:00:30
# Change the display format (mm:ss.zzz) / (mm:ss)
sw -f %M:%S
sw -f %M:%S -m
# Execute cmd after the countdown
sw -c 00:00:30 && cmd
# Measure the execution time of a process
ping localhost -c 3 | sw

# On unix system, you can change the display color
./sw --fg 97 --bg 45

C++ Sample

Stopwatch sw;
sw.start();

// do something

// https://en.cppreference.com/w/cpp/io/manip/put_time
cout << sw.elapsed("%H:%M:%S", true) << endl;

About

A command line stopwatch

License:MIT License


Languages

Language:C++ 96.0%Language:Makefile 4.0%