17 lines
178 B
C++
17 lines
178 B
C++
|
|
||
|
#pragma once
|
||
|
|
||
|
namespace timing {
|
||
|
|
||
|
inline uint32_t at = 0;
|
||
|
inline uint32_t diff = 0;
|
||
|
|
||
|
inline void update() {
|
||
|
uint32_t now = micros();
|
||
|
diff = now - at;
|
||
|
at = now;
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|