Fix integer overflow in THROTTLE first call

Initializing m_last to time_point::min() causes signed integer
overflow when computing now - m_last, since the nanosecond
difference exceeds int64_t range. Initialize to now - interval
instead so the first Ready() call passes naturally.
This commit is contained in:
Seth Hillbrand
2026-03-03 12:30:32 -08:00
parent d3f8e967c7
commit b404b30fb9
+1 -1
View File
@@ -36,7 +36,7 @@ class THROTTLE
public:
explicit THROTTLE( std::chrono::milliseconds aInterval ) :
m_interval( aInterval ),
m_last( std::chrono::steady_clock::time_point::min() )
m_last( std::chrono::steady_clock::now() - aInterval )
{
}