

Invalid results from the latter functions. Performing mathematical operations and then passing their resultsĪs arguments to ticks_diff() or ticks_add() will also lead to Operators (, >=) directly on these value will lead to invalid Note: Performing standard mathematical operations (+, -) or relational The only operations available for themĪre ticks_diff() and ticks_add() functions described below. For the most part, you should treat values Thus, these functions will return a value in range Period value is used for all of ticks_ms(), ticks_us(), ticks_cpu() functions To be a power of two, but otherwise may differ from port to port. The values is TICKS_PERIOD = TICKS_MAX + 1. This value is not explicitly exposed,īut we will refer to it as TICKS_MAX to simplify discussion. Returns an increasing millisecond counter with an arbitrary reference point,

sleep_us ( us ) ¶ĭelay for given number of microseconds, should be positive or 0 utime.

sleep_ms ( ms ) ¶ĭelay for given number of milliseconds, should be positive or 0. Not accept floating-point argument, for compatibility with them use sleep_ms()Īnd sleep_us() functions. Sleep for a fractional number of seconds. Seconds can be a floating-point number to year includes the century (for example 2014).If secs is not provided or None, then the current time from the RTC is used. localtime ( ) ¶Ĭonvert a time expressed in seconds since the Epoch (see above) into an 8-tuple whichĬontains: (year, month, mday, hour, minute, second, weekday, yearday) If actual calendar time is not maintained with a system/MicroPython RTC,įunctions below which require reference to current absolute time mayįunctions ¶ utime. RTC time across hard resets, though some may require setting it again Set manually by a user on each power-up (many boards then maintain.Using networked time protocol (requires setup by a port/user).By a backup battery (which may be an additional, optional component for.May be set using machine.RTC().datetime(tuple) function, and maintained System time depends on machine.RTC() object. Time is responsibility of OS/RTOS and is done outside of MicroPython, On systems with underlying OS (including some Maintaining actual calendar date/time: This requires a Time Epoch: Unix port uses standard for POSIX systems epoch of Measuring time intervals, and for delays. The utime module provides functions for getting the current time and date,
