minor changes
parent
8300aefbed
commit
7086fbdd29
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/vedhavyas/go-wasm"
|
"github.com/vedhavyas/go-wasm"
|
||||||
|
@ -59,7 +58,7 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
fmt.Println(bytes)
|
log.Println(bytes)
|
||||||
|
|
||||||
res, err = b.CallFunc("getError", nil)
|
res, err = b.CallFunc("getError", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -71,5 +70,5 @@ func main() {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(verr)
|
log.Println(verr)
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,8 +72,8 @@ func nanotime(ctx unsafe.Pointer, sp int32) {
|
||||||
func walltime(ctx unsafe.Pointer, sp int32) {
|
func walltime(ctx unsafe.Pointer, sp int32) {
|
||||||
b := getBridge(ctx)
|
b := getBridge(ctx)
|
||||||
t := time.Now().UnixNano()
|
t := time.Now().UnixNano()
|
||||||
nanos := t % 1000000000
|
nanos := t % int64(time.Second)
|
||||||
b.setInt64(sp+8, t/1000000000)
|
b.setInt64(sp+8, t/int64(time.Second))
|
||||||
b.setInt32(sp+16, int32(nanos))
|
b.setInt32(sp+16, int32(nanos))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue