Skip to content

ThiBsc/stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

Releases

No releases published

Packages

No packages published