Skip to content

Commit c5eec2e

Browse files
committed
compiler/natives/src/time: Update now signature for monotonic time.
Fixes: $GOROOT/src/time/time.go:1049:21: cannot initialize 3 variables with 2 values $GOROOT/src/time/zoneinfo_read.go:202:15: cannot initialize 3 variables with 2 values
1 parent 0cbbd7f commit c5eec2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/natives/src/time/time.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ func runtimeNano() int64 {
4242
return js.Global.Get("Date").New().Call("getTime").Int64() * int64(Millisecond)
4343
}
4444

45-
func now() (sec int64, nsec int32) {
45+
func now() (sec int64, nsec int32, mono int64) {
46+
// TODO: Use mono if needed/possible.
4647
n := runtimeNano()
47-
return n / int64(Second), int32(n % int64(Second))
48+
return n / int64(Second), int32(n % int64(Second)), 0
4849
}
4950

5051
func Sleep(d Duration) {

0 commit comments

Comments
 (0)