mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-25 20:06:08 +00:00
18 lines
380 B
C++
18 lines
380 B
C++
/**
|
|
* @copyright Utilitech AS 2023
|
|
* License: Fair Source
|
|
*
|
|
*/
|
|
|
|
#include "Uptime.h"
|
|
|
|
uint32_t _uptime_last_value = 0;
|
|
uint32_t _uptime_rollovers = 0;
|
|
|
|
uint64_t millis64() {
|
|
uint32_t new_low32 = millis();
|
|
if (new_low32 < _uptime_last_value) _uptime_rollovers++;
|
|
_uptime_last_value = new_low32;
|
|
return (uint64_t) _uptime_rollovers << 32 | _uptime_last_value;
|
|
}
|