mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 14:53:46 +00:00
Fix JS bug in std/monotimes (#12499) [backport]
This commit is contained in:
committed by
Andreas Rumpf
parent
4ac100c912
commit
3d0c756a3c
@@ -58,6 +58,7 @@ when defined(macosx):
|
||||
|
||||
when defined(js):
|
||||
proc getJsTicks: float =
|
||||
## Returns ticks in the unit seconds
|
||||
{.emit: """
|
||||
var isNode = typeof module !== 'undefined' && module.exports
|
||||
|
||||
@@ -66,7 +67,7 @@ when defined(js):
|
||||
var time = process.hrtime()
|
||||
return time[0] + time[1] / 1000000000;
|
||||
} else {
|
||||
return window.performance.now() * 1000000;
|
||||
return window.performance.now() / 1000;
|
||||
}
|
||||
""".}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user