mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Remove now-unused Duration methods
These are not applicable to Duration, since it's not a timestamp class.
This commit is contained in:
parent
effcd080ca
commit
69e27169c4
Notes:
sideshowbarker
2024-07-17 08:34:29 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/69e27169c4 Pull-request: https://github.com/SerenityOS/serenity/pull/17842 Reviewed-by: https://github.com/me-minus Reviewed-by: https://github.com/timschumi
2 changed files with 0 additions and 30 deletions
10
AK/Time.cpp
10
AK/Time.cpp
|
@ -217,16 +217,6 @@ static Duration now_time_from_clock(clockid_t clock_id)
|
|||
}
|
||||
}
|
||||
|
||||
Duration Duration::now_realtime()
|
||||
{
|
||||
return now_time_from_clock(CLOCK_REALTIME);
|
||||
}
|
||||
|
||||
Duration Duration::now_realtime_coarse()
|
||||
{
|
||||
return now_time_from_clock(CLOCK_REALTIME_COARSE);
|
||||
}
|
||||
|
||||
Duration Duration::now_monotonic()
|
||||
{
|
||||
return now_time_from_clock(CLOCK_MONOTONIC);
|
||||
|
|
20
AK/Time.h
20
AK/Time.h
|
@ -191,24 +191,6 @@ private:
|
|||
}
|
||||
|
||||
public:
|
||||
[[nodiscard]] constexpr static Duration from_timestamp(i32 year, u8 month, u8 day, u8 hour, u8 minute, u8 second, u16 millisecond)
|
||||
{
|
||||
constexpr auto milliseconds_per_day = 86'400'000;
|
||||
constexpr auto milliseconds_per_hour = 3'600'000;
|
||||
constexpr auto milliseconds_per_minute = 60'000;
|
||||
constexpr auto milliseconds_per_second = 1'000;
|
||||
|
||||
i64 milliseconds_since_epoch = days_since_epoch(year, month, day);
|
||||
milliseconds_since_epoch *= milliseconds_per_day;
|
||||
|
||||
milliseconds_since_epoch += hour * milliseconds_per_hour;
|
||||
milliseconds_since_epoch += minute * milliseconds_per_minute;
|
||||
milliseconds_since_epoch += second * milliseconds_per_second;
|
||||
milliseconds_since_epoch += millisecond;
|
||||
|
||||
return from_milliseconds(milliseconds_since_epoch);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr static Duration from_seconds(i64 seconds) { return Duration(seconds, 0); }
|
||||
[[nodiscard]] constexpr static Duration from_nanoseconds(i64 nanoseconds)
|
||||
{
|
||||
|
@ -234,8 +216,6 @@ public:
|
|||
[[nodiscard]] constexpr static Duration max() { return Duration(__INT64_MAX__, 999'999'999); };
|
||||
|
||||
#ifndef KERNEL
|
||||
[[nodiscard]] static Duration now_realtime();
|
||||
[[nodiscard]] static Duration now_realtime_coarse();
|
||||
[[nodiscard]] static Duration now_monotonic();
|
||||
[[nodiscard]] static Duration now_monotonic_coarse();
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue