rusefi/unit_tests/tests/util/test_timer.cpp

14 lines
291 B
C++
Raw Normal View History

#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) {
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));
}