1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: fix sys_mono_now for the JS backend (#12187)

This commit is contained in:
playX 2021-10-15 09:22:15 +03:00 committed by GitHub
parent c29a5cdedb
commit d3887c1568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,11 +4,11 @@ module time
#var $seen = 0
#function $sys_mono_new_Date() {
#var t = Date.now()
#if (t < seen)
#timeOff += (seen - t)
#if (t < $seen)
#$timeOff += ($seen - t)
#
#seen = t
#return t + timeOff
#$seen = t
#return t + $timeOff
#}
pub fn sys_mono_now() u64 {
@ -19,7 +19,7 @@ pub fn sys_mono_now() u64 {
return res
} $else $if js_node {
mut res := u64(0)
#res.val = Number($process.hrtime.bigint())
#res.val = $process.hrtime.bigint()
return res
} $else {