diff --git a/waku/v2/utils/time.nim b/waku/v2/utils/time.nim new file mode 100644 index 000000000..6b9cd7967 --- /dev/null +++ b/waku/v2/utils/time.nim @@ -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 \ No newline at end of file