2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
2023-08-30 20:11:24 -07:00
|
|
|
#include <rusefi/timer.h>
|
2021-03-11 21:43:48 -08:00
|
|
|
|
|
|
|
TEST(util, timer) {
|
2023-05-31 22:31:28 -07:00
|
|
|
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
2021-03-11 21:43:48 -08:00
|
|
|
Timer timer;
|
|
|
|
ASSERT_TRUE(timer.hasElapsedSec(3));
|
|
|
|
timer.reset();
|
|
|
|
ASSERT_FALSE(timer.hasElapsedSec(3));
|
|
|
|
|
|
|
|
eth.moveTimeForwardSec(4);
|
|
|
|
ASSERT_TRUE(timer.hasElapsedSec(3));
|
|
|
|
}
|