11# TickTock
22
3+ | ** Build Status** | ** Code Coverage** |
4+ | :-----------------------------------------:| :-------------------------------:|
5+ | [ ![ Build Status] [ ci-img ]] [ ci-url ] | [ ![ ] [ codecov-img ]] [ codecov-url ] |
6+
7+
38![ tick tock] ( images/ticktock.gif )
49
5- [ ![ Build Status] [ travis-img ]] [ travis-url ] | [ ![ ] [ codecov-img ]] [ codecov-url ] | [ ![ Build Status] [ appvey-img ]] [ appvey-url ]
6-
710This module provides simple timer functions:
811
912- ` tick() ` start a timer
@@ -28,29 +31,29 @@ You can:
2831``` julia
2932julia> using TickTock
3033julia> tick ()
31- Started timer at 2017 - 12 - 13 T22: 30 : 59.632
34+ [ Info : started timer at 2017 - 12 - 13 T22: 30 : 59.632
3235julia> tock ()
33- 55.052638936 ms : 55 seconds, 52 milliseconds
36+ [ Info : 55.052638936 s : 55 seconds, 52 milliseconds
3437```
3538
3639- see how long your cup of tea's been brewing:
3740
3841``` julia
3942julia> tick ()
40- Started timer at 2017 - 12 - 13 T22: 34 : 03.78
43+ [ Info : started timer at 2017 - 12 - 13 T22: 34 : 03.78
4144julia> laptimer ()
42- 72.625839832 ms : 1 minute, 12 seconds, 625 milliseconds
45+ [ Info : 72.625839832 s : 1 minute, 12 seconds, 625 milliseconds
4346julia> laptimer ()
44- 266.053953749 ms : 4 minutes, 26 seconds, 53 milliseconds
47+ [ Info : 266.053953749 s : 4 minutes, 26 seconds, 53 milliseconds
4548julia> laptimer ()
46- 285.314459174 ms : 4 minutes, 45 seconds, 314 milliseconds
49+ [ Info : 285.314459174 s : 4 minutes, 45 seconds, 314 milliseconds
4750```
4851
4952- see how many seconds you held your breath for:
5053
5154``` julia
5255julia> tick ()
53- Started timer at 2017 - 12 - 12 T09: 17 : 45.504
56+ [ Info : started timer at 2017 - 12 - 12 T09: 17 : 45.504
5457
5558julia> tok ()
5659287.841546621
@@ -62,7 +65,7 @@ julia> tok()
6265julia> tick ()
6366... go on holiday, then come back
6467julia> laptimer ()
65- 1.302200135485876e6 s: 2 weeks, 1 day, 1 hour, 43 minutes, 20 seconds, 135 milliseconds
68+ [ Info : 1.302200135485876e6 s: 2 weeks, 1 day, 1 hour, 43 minutes, 20 seconds, 135 milliseconds
6669```
6770
6871- time a number of things:
@@ -73,8 +76,8 @@ julia> tick()
7376julia> tick ()
7477 started timer at: 2018 - 03 - 17 T12: 14 : 03.077
7578julia> laptimer ()
76- 2 7.315769543 s: 7 seconds, 315 milliseconds
77- 1 327.074715234 s: 5 minutes, 27 seconds, 74 milliseconds
79+ 2 [ Info : 7.315769543 s: 7 seconds, 315 milliseconds
80+ 1 [ Info : 327.074715234 s: 5 minutes, 27 seconds, 74 milliseconds
7881```
7982
8083- set an alarm to wake up in 1m30s:
@@ -89,7 +92,16 @@ julia> @async alarm(now() + Dates.Minute(1) + Dates.Second(30))
8992
9093``` julia
9194julia> @async alarm (now () + Dates. Minute (0 ) + Dates. Second (5 ),
92- action = () -> run (` say "wake up"` )) # macOS speech command
95+ action = () -> run (` say "wake up"` )) # MacOS speech command
96+ ```
97+
98+ - check alarms
99+
100+ ``` julia
101+ julia> alarmlist ()
102+
103+ start | duration | finish | name
104+ 13 : 22 : 37 | 00 : 01 : 30 | 13 : 24 : 07 | TickTock alarm
93105```
94106
95107You should *not* use this package to:
@@ -98,17 +110,18 @@ You should *not* use this package to:
98110
99111- do benchmarking of Julia code
100112
101- ## History
113+ You can hide the message generated by `tick()` using:
102114
103- Some of this code used to live in Julia Base in the ` tic() ` , ` toc() ` , and ` toq() ` functions (in base/util.jl). They were deprecated in GitHub issue [ 17046 ] ( https://github.com/JuliaLang/ julia/issues/17046 ) .
104-
105- [ pkgeval-link ] : http://pkg.julialang.org/?pkg=TickTock
115+ ``` julia
116+ ENV [ " TICKTOCK_MESSAGES " ] = false
117+ ```
106118
107- [ travis-img ] : https://travis-ci.org/cormullion/TickTock.jl.svg?branch=master
108- [ travis-url ] : https://travis-ci.org/cormullion/TickTock.jl
119+ ## History
109120
110- [ appvey-img ] : https://ci.appveyor.com/api/projects/status/jfa9e54lv92rqd3m?svg=true
111- [ appvey-url ] : https://ci.appveyor.com/project/cormullion/ticktock-jl/branch/master
121+ Some of this code used to live in Julia Base in the `tic()`, `toc()`, and `toq()` functions (in base/util.jl). They were deprecated in GitHub issue [17046](https://github.com/JuliaLang/julia/issues/17046).
112122
113123[codecov-img]: https://codecov.io/gh/cormullion/TickTock.jl/branch/master/graph/badge.svg
114124[codecov-url]: https://codecov.io/gh/cormullion/TickTock.jl
125+
126+ [ci-img]: https://github.com/cormullion/TickTock.jl/workflows/CI/badge.svg
127+ [ci-url]: https://github.com/cormullion/TickTock.jl/actions?query=workflow%3ACI
0 commit comments