6.22. kink/STOPWATCH¶
6.22.1. STOPWATCH.start¶
`start` returns a new stopwatch thunk.
The stopwatch thunk returns the elapsed time from the invocation of `start` in seconds, with precision of nanoseconds.
The result of the stopwatch thunk is a non-negative `num` with Scale=9.
Example
The output varies for each execution.
:STOPWATCH.require_from('kink/')
:THREAD.require_from('kink/thread/')
:elapsed_seconds <- STOPWATCH.start
THREAD.sleep(1)
stdout.print_line(elapsed_seconds.repr) # => 1.001089645
THREAD.sleep(2)
stdout.print_line(elapsed_seconds.repr) # => 3.004145317