mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
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:
committed by
Ron Evans
parent
abc373dc73
commit
41e501aaf4
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user