Skip to content

Commit

Permalink
compiler/natives/src/time: Update now signature for monotonic time.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dmitshur committed Jun 23, 2017
1 parent 188170c commit 8520499
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/natives/src/time/time.go
Expand Up @@ -42,9 +42,10 @@ func runtimeNano() int64 {
return js.Global.Get("Date").New().Call("getTime").Int64() * int64(Millisecond)
}

func now() (sec int64, nsec int32) {
func now() (sec int64, nsec int32, mono int64) {
// TODO: Use mono if needed/possible.
n := runtimeNano()
return n / int64(Second), int32(n % int64(Second))
return n / int64(Second), int32(n % int64(Second)), 0
}

func Sleep(d Duration) {
Expand Down

0 comments on commit 8520499

Please sign in to comment.