elapsed
Elapsed time calculator
Import
_ <- fat.extra.elapsed
Methods
Name | Signature | Brief |
---|---|---|
getElapsed | (since: Epoch): Text | Return elapsed time as text |
showElapsed | (label: Text, since: Epoch): Text | Log line with elapsed time |
time library is automatically imported with this import
Usage Notes
Example:
_ <- fat.extra.elapsed
start = now() # see: time library
ms = 300
wait(ms)
showElapsed('took', start) # prints 'took 300 ms'
elapsed will automatically round up milliseconds to seconds, minutes or hours, keeping only the integer part only