]> CyberLeo.Net >> Repos - CDN/shlib.git/blob - test/stopwatch.sh
sh/stopwatch: simple stopwatch for timing things
[CDN/shlib.git] / test / stopwatch.sh
1 #!/bin/sh
2
3 _root="$(readlink -f "$(dirname "${0}")/../")"; . "${_root}/lib/sh/env.sh"
4
5 want stopwatch
6
7 stopwatch test start
8 _stopwatch_timefmt 10
9 echo
10 stopwatch test lap
11 _stopwatch_timefmt 30
12 echo
13 stopwatch test lap
14 _stopwatch_timefmt 59
15 echo
16 stopwatch test lap
17 _stopwatch_timefmt 60
18 echo
19 stopwatch test lap
20 _stopwatch_timefmt 61
21 echo
22 stopwatch test lap
23 _stopwatch_timefmt 86399
24 echo
25 stopwatch test lap
26 _stopwatch_timefmt 99999999
27 echo
28 stopwatch test stop
29 stopwatch test reset
30
31 stopwatch test start
32 sleep 5
33 stopwatch test lap
34 sleep 5
35 stopwatch test lap
36 sleep 5
37 stopwatch test stop
38 sleep 5
39 stopwatch test start
40 sleep 5
41 stopwatch test stop
42 sleep 5
43 stopwatch test reset
44 sleep 5
45 stopwatch test stop
46