ut-function.timing
v1.2.0
Published
Time intervals and high resolution time helpers
Downloads
24
Readme
ut-function.timing
Time intervals and high resolution time helpers, browser compatible
Usage
const {diff, after, isAfter, now, spare} = require('ut-function.timing')
Where
diff(time1, time2)
- difference in milliseconds between two high resolution time valuestime1
andtime2
after(interval)
- get local high resolution time value after specified timeinterval
in millisecondsisAfter(time, timeout)
- check if high resolutiontime
is after high resolution valuetimeout
now
- get curren time as high resolution valuespare(time, latency)
- get remaining time between current time and passedtime
, minus the optional expected network or otherlatency