1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

AK: Rename Time to Duration

That's what this class really is; in fact that's what the first line of
the comment says it is.

This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
This commit is contained in:
kleines Filmröllchen 2023-03-13 16:30:34 +01:00 committed by Jelle Raaijmakers
parent 82ddc813d5
commit 213025f210
140 changed files with 634 additions and 628 deletions

View file

@ -17,7 +17,7 @@ public:
static Core::ElapsedTimer signal_timer;
static constexpr auto timer_value = Time::from_seconds(1);
static constexpr auto timer_value = Duration::from_seconds(1);
static void test_signal_handler(int signal)
{
@ -25,7 +25,7 @@ public:
auto expected_duration = SuccessContext::timer_value;
// Add a small buffer to allow for latency on the system.
constexpr auto buffer_duration = Time::from_milliseconds(50);
constexpr auto buffer_duration = Duration::from_milliseconds(50);
dbgln("Signal Times - Actual: {} Expected: {}", actual_duration.to_milliseconds(), expected_duration.to_milliseconds());
EXPECT(actual_duration >= expected_duration);
@ -47,7 +47,7 @@ TEST_CASE(success_case)
auto previous_time = alarm(SuccessContext::timer_value.to_seconds());
EXPECT_EQ(previous_time, 0u);
auto sleep_time = SuccessContext::timer_value + Time::from_seconds(1);
auto sleep_time = SuccessContext::timer_value + Duration::from_seconds(1);
sleep(sleep_time.to_seconds());
EXPECT(SuccessContext::alarm_fired);
@ -57,7 +57,7 @@ TEST_CASE(success_case)
// See: https://github.com/SerenityOS/serenity/issues/9071
TEST_CASE(regression_inifinite_loop)
{
constexpr auto hour_long_timer_value = Time::from_seconds(60 * 60);
constexpr auto hour_long_timer_value = Duration::from_seconds(60 * 60);
// Create an alarm timer significantly far into the future.
auto previous_time = alarm(hour_long_timer_value.to_seconds());