mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:18:13 +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:
parent
82ddc813d5
commit
213025f210
140 changed files with 634 additions and 628 deletions
|
@ -165,11 +165,11 @@ TimeZone* system_time_zone(VM& vm)
|
|||
BigInt* system_utc_epoch_nanoseconds(VM& vm)
|
||||
{
|
||||
// 1. Let ns be the approximate current UTC date and time, in nanoseconds since the epoch.
|
||||
auto now = Time::now_realtime().to_nanoseconds();
|
||||
auto now = AK::Duration::now_realtime().to_nanoseconds();
|
||||
auto ns = Crypto::SignedBigInteger { now };
|
||||
|
||||
// 2. Set ns to the result of clamping ns between nsMinInstant and nsMaxInstant.
|
||||
// NOTE: Time::to_nanoseconds() already clamps between -(2^63) and 2^63 - 1, the range of an i64,
|
||||
// NOTE: Duration::to_nanoseconds() already clamps between -(2^63) and 2^63 - 1, the range of an i64,
|
||||
// if an overflow occurs during seconds -> nanoseconds conversion.
|
||||
|
||||
// 3. Return ℤ(ns).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue