CX time - SkycoinWikis/CX GitHub Wiki
HOME » NATIVE PACKAGES » TIME
To use the time-Functions you first have to import it:
import "time" By calling this function you force the code to pause the given amount of milliseconds
time.Sleep(milliseconds_to_pause i32)Example
//time.Sleep
////input
var milliseconds_to_pause i32 = 1000
////function call
time.Sleep(milliseconds_to_pause)This function returns the elapsed milliseconds since 01.01.1970 UTC
time.UnixMilli()(milliseconds_since_01011970 i64)Example
//time.UnixMilli
////output
var milliseconds_since_01011970 i64
////function call
milliseconds_since_01011970 = time.UnixMilli()This function returns the elapsed nanoseconds since 01.01.1970 UTC
time.UnixNano()(nanoseconds_since_01011970 i64)Example
//time.UnixNano
////output
var nanoseconds_since_01011970 i64
////function call
nanoseconds_since_01011970 = time.UnixNano()