Fix JS bug in std/monotimes (#12499) [backport]
This commit is contained in:
parent
4ac100c912
commit
3d0c756a3c
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
""".}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue