demo: c ClockGettime (CLOCK_REALTIME/MONOTONIC)

This commit is contained in:
xushiwei
2024-06-26 21:20:47 +08:00
parent 188ec6ea1d
commit 44f8c98660
2 changed files with 14 additions and 2 deletions

12
_demo/ctime/time.go Normal file
View File

@@ -0,0 +1,12 @@
package main
import "github.com/goplus/llgo/c/time"
func main() {
var tv time.Timespec
time.ClockGettime(time.CLOCK_REALTIME, &tv)
println("REALTIME sec:", tv.Sec, "nsec:", tv.Nsec)
time.ClockGettime(time.CLOCK_MONOTONIC, &tv)
println("MONOTONIC sec:", tv.Sec, "nsec:", tv.Nsec)
}