diff options
author | Oscar NihlgÄrd <oscarnihlgard@gmail.com> | 2019-10-24 11:24:26 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-10-24 11:24:26 +0200 |
commit | 3d0c756a3c87d23b4920ef2d1a0b161f42da5b87 (patch) | |
tree | 20c6d6ee25a9ccb3d72dfb99d0e2c5fb285a914a /lib/std/monotimes.nim | |
parent | 4ac100c9122231ce82f56b51f86ee6e906e0b389 (diff) | |
download | Nim-3d0c756a3c87d23b4920ef2d1a0b161f42da5b87.tar.gz |
Fix JS bug in std/monotimes (#12499) [backport]
Diffstat (limited to 'lib/std/monotimes.nim')
-rw-r--r-- | lib/std/monotimes.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/monotimes.nim b/lib/std/monotimes.nim index d2d9717d7..4c570d2ee 100644 --- a/lib/std/monotimes.nim +++ b/lib/std/monotimes.nim @@ -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; } """.} |