runtime: move timeUnit to a single place

The timeUnit is now the same type everywhere. Move it to a single place
and add some documentation to it.
This commit is contained in:
Ayke van Laethem
2025-04-12 12:54:06 +02:00
committed by Ron Evans
parent abc373dc73
commit 41e501aaf4
27 changed files with 13 additions and 58 deletions
+11
View File
@@ -8,6 +8,17 @@ import (
const Compiler = "tinygo"
// Unit for the 'ticks' and 'sleepTicks' functions.
//
// This is the native time unit for the given system. One timeUnit tick might be
// 1ns or 100ns on a desktop system, or 1/32768s on baremetal systems with a
// low-power RTC. Many other tick durations are possible.
//
// Conversion from time units to nanoseconds and back is done using
// ticksToNanoseconds and nanosecondsToTicks, which need to be implemented for
// each system as needed.
type timeUnit int64
// The compiler will fill this with calls to the initialization function of each
// package.
func initAll()