Skip to content

Commit 0e1a373

Browse files
committed
docstrings updated
1 parent f6fce04 commit 0e1a373

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
![tick tock](images/ticktock.gif)
44

5-
This module provides `tick()`, `tock()`, and `tok()` functions. They're similar to the `tic()`, `toc()`, and `toq()` functions that you might find in MATLAB and
6-
similar software. There are also `lap()` and `peek()` functions that reveal the state of the current timer without stopping it.
5+
This module provides `tick()`, `tock()`, and `tok()` functions. They're similar to the `tic()`, `toc()`, and `toq()` functions that you might find in MATLAB and similar software. There are also `lap()` and `peek()` functions that reveal the state of the current timer without stopping it.
76

8-
**Don't use these for timing code execution!** Julia provides much better facilities for
9-
measuring performance, ranging from the `@time` and `@elapsed` macros to packages such as [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl). (And remember, don't
10-
time Julia code running in global scope!) The [TimerOutputs.jl](https://github.com/KristofferC/TimerOutputs.jl) package provides tools for timing different sections of a program.
7+
**Don't use these for timing code execution!** Julia provides much better facilities for measuring performance, ranging from the `@time` and `@elapsed` macros to packages such as [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl). (And remember, don't time Julia code running in global scope!) The [TimerOutputs.jl](https://github.com/KristofferC/TimerOutputs.jl) package provides tools for timing different sections of a program.
118

129
## Functions
1310

@@ -17,7 +14,7 @@ time Julia code running in global scope!) The [TimerOutputs.jl](https://github.c
1714
- `peek()` continue counting, return elapsed seconds
1815
- `lap()` continue counting, show total elapsed time
1916

20-
## Suggestions for use
17+
## Suggestions for use
2118

2219
You can:
2320

src/TickTock.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
"""
22
This module provides `tick()`, `tock()`, and `tok()` functions.
33
4-
They're similar to the `tic()`, `toc()`, and `toq()` functions that you might find in MATLAB and
5-
similar software.
4+
They're similar to the `tic()`, `toc()`, and `toq()` functions that you might find in MATLAB
5+
and similar software.
66
77
Don't use these for timing code execution! Julia provides much better facilities for
8-
measuring performance, ranging from the `@time` and `@elapsed` macros to packages such as [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl). (And remember, don't
8+
measuring performance, ranging from the `@time` and `@elapsed` macros to packages such as
9+
[BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl). (And remember, don't
910
time Julia code running in global scope!)
1011
11-
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).
12+
This code used to live in Julia Base as the `tic()`, `toc()`, and `toq()` functions
13+
(in base/util.jl). They were deprecated in GitHub issue [17046](https://github.com/JuliaLang/julia/issues/17046).
1214
"""
1315

1416
module TickTock
@@ -22,7 +24,12 @@ end
2224
"""
2325
tick()
2426
25-
Start counting.
27+
Start counting. The other functions are:
28+
29+
- `tock()` stop counting, show total elapsed time in canonical form
30+
- `tok()` stop counting, return seconds
31+
- `peek()` continue counting, return elapsed seconds
32+
- `lap()` continue counting, show total elapsed time in canonical form
2633
"""
2734
function tick()
2835
t0 = time_ns()
@@ -33,7 +40,7 @@ end
3340
"""
3441
peek()
3542
36-
Return the seconds counted by the current timer, without stopping it.
43+
Return the current elapsed seconds counted by the current timer, without stopping it.
3744
"""
3845
function peek()
3946
t1 = time_ns()

0 commit comments

Comments
 (0)