Replace time with std::time in components/metrics & components/shared (#31020)

This commit is contained in:
Taym Haddadi 2024-01-10 20:23:47 +01:00 committed by GitHub
parent e3e0d8f2c4
commit 92196d985d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 53 additions and 27 deletions

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::time::{SystemTime, UNIX_EPOCH};
use ipc_channel::ipc;
use metrics::{InteractiveFlag, InteractiveMetrics, ProfilerMetadataFactory, ProgressiveWebMetric};
use profile_traits::time::{ProfilerChan, TimerMetadata};
@ -108,7 +110,10 @@ fn test_set_tti_mta() {
let dcl = interactive.get_dom_content_loaded();
assert!(dcl.is_some());
let t = time::precise_time_ns();
let t = SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_nanos() as u64;
interactive.maybe_set_tti(
&profiler_metadata_factory,
InteractiveFlag::TimeToInteractive(t),