mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Replace time with std::time in components/metrics & components/shared (#31020)
This commit is contained in:
parent
e3e0d8f2c4
commit
92196d985d
8 changed files with 53 additions and 27 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue