github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/runtime/scheduler_none.go (about) 1 //go:build scheduler.none 2 3 package runtime 4 5 //go:linkname sleep time.Sleep 6 func sleep(duration int64) { 7 if duration <= 0 { 8 return 9 } 10 11 sleepTicks(nanosecondsToTicks(duration)) 12 } 13 14 // getSystemStackPointer returns the current stack pointer of the system stack. 15 // This is always the current stack pointer. 16 func getSystemStackPointer() uintptr { 17 return getCurrentStackPointer() 18 } 19 20 // run is called by the program entry point to execute the go program. 21 // With the "none" scheduler, init and the main function are invoked directly. 22 func run() { 23 initHeap() 24 initAll() 25 callMain() 26 } 27 28 const hasScheduler = false