summaryrefslogtreecommitdiff
path: root/vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go')
-rw-r--r--vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go b/vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go
new file mode 100644
index 000000000..ff01d90ce
--- /dev/null
+++ b/vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go
@@ -0,0 +1,11 @@
+//go:build cgo && !windows
+
+package platform
+
+import _ "unsafe" // for go:linkname
+
+// nanotime uses runtime.nanotime as it is available on all platforms and
+// benchmarks faster than using time.Since.
+//
+//go:linkname nanotime runtime.nanotime
+func nanotime() int64