Time util file

This commit is contained in:
s1fr0 2022-02-04 23:59:20 +01:00
parent 2b5c360746
commit 08ca99b6f6
1 changed files with 15 additions and 0 deletions

15
waku/v2/utils/time.nim Normal file
View File

@ -0,0 +1,15 @@
## Contains types and utilities for timestamps.
{.push raises: [Defect].}
proc getNanosecondTime*(t: float64): int64 =
var tns = t*100000000
return tns
proc getMicrosecondTime*(t: float64): int64 =
var tmus = t*1000000
return tns
proc getMillisecondTime*(t: float64): int64 =
var tms = t*1000
return tms