mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gg: add text rendering, keyboard event handling for JS and other fixes (#12932)
This commit is contained in:
@@ -42,3 +42,10 @@ pub fn sleep(dur Duration) {
|
||||
#let toWait = BigInt(dur.val) / BigInt(time__millisecond)
|
||||
#while (new Date().getTime() < now + Number(toWait)) {}
|
||||
}
|
||||
|
||||
pub fn ticks() i64 {
|
||||
t := i64(0)
|
||||
#t.val = BigInt(new Date().getTime())
|
||||
|
||||
return t
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ module time
|
||||
pub fn sys_mono_now() u64 {
|
||||
$if js_browser {
|
||||
mut res := u64(0)
|
||||
#res = new u64(window.performance.now() * 1000000)
|
||||
#res = new u64(Math.floor(window.performance.now() * 1000000))
|
||||
|
||||
return res
|
||||
} $else $if js_node {
|
||||
|
Reference in New Issue
Block a user