Skip to content

Commit

Permalink
add sleep to have non-zero time on faster machines
Browse files Browse the repository at this point in the history
  • Loading branch information
andgineer committed Mar 13, 2020
1 parent f7c3936 commit 5f0dfd8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bombard/pretty_ns.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
Usage:
>>> start = time_ns()
>>> pass # code to time
>>> import time
>>> time.sleep(0.0000001)
>>> pretty_ns((start + 100) - start)
'0.1 mks'
>>> with Timer() as timer:
... pass
... import time
... time.sleep(0.0000001)
... timer.pretty.endswith('s')
... timer.ns > 0
True
Expand Down

0 comments on commit 5f0dfd8

Please sign in to comment.