Closed dtex closed 6 years ago
Some observations about all this:
Running a resolution of 0.01 results in more frequent visits from the garbage collector, so it's really not recommended.
A resolution of 0.1 regularly outperforms 1.0 on a fast MBP, but will likely run slower on SBC's.
There doesn't appear to be any benefit to staying with Date.now() for >=1ms resolution, but again slower computers (PI's, T2's) might behave differently so I'm not changing the functionality until I've tested on more of those.
The 500 microsecond hits to Map.get()
and Map.set()
appear to be "smoothed out" by Date.now(). I think it's just a result of the way Date.now() works.
Allow temporal to be passed sub-millisecond delays.
I used this performance test to make sure things actually worked better:
https://gist.github.com/dtex/8d24cbd5608c1bcb6b62456bf965ee61