File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2787,7 +2787,9 @@ proc epochTime*(): float {.tags: [TimeEffect].} =
2787
2787
# #
2788
2788
# # .. warning:: Unsuitable for benchmarking (but still better than `now`),
2789
2789
# # use `monotimes.getMonoTime` or `cpuTime` instead, depending on the use case.
2790
- when defined (macosx):
2790
+ when defined (js):
2791
+ result = newDate ().getTime () / 1000
2792
+ elif defined (macosx):
2791
2793
var a {.noinit .}: Timeval
2792
2794
gettimeofday (a)
2793
2795
result = toBiggestFloat (a.tv_sec.int64 ) + toBiggestFloat (
@@ -2804,8 +2806,6 @@ proc epochTime*(): float {.tags: [TimeEffect].} =
2804
2806
var secs = i64 div rateDiff
2805
2807
var subsecs = i64 mod rateDiff
2806
2808
result = toFloat (int (secs)) + toFloat (int (subsecs)) * 0.0000001
2807
- elif defined (js):
2808
- result = newDate ().getTime () / 1000
2809
2809
else :
2810
2810
{.error : " unknown OS" .}
2811
2811
You can’t perform that action at this time.
0 commit comments