From e4efdfe668c05c4110a7183af452dfa04f801571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20M=C5=93ller?= Date: Thu, 27 Mar 2025 11:02:53 +0100 Subject: [PATCH] Made MAX_TASK_NS u128. Also removed a superfluous into(). Both were required to fix #36122 with nightly 1.85.0 (4d91de4e4 2025-02-17). (#36169) Signed-off-by: Moritz Moeller --- components/metrics/lib.rs | 2 +- components/script/script_thread.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/metrics/lib.rs b/components/metrics/lib.rs index 4f42c2f7bbe..ea1b182b457 100644 --- a/components/metrics/lib.rs +++ b/components/metrics/lib.rs @@ -18,7 +18,7 @@ use servo_url::ServoUrl; /// TODO make this configurable /// maximum task time is 50ms (in ns) -pub const MAX_TASK_NS: u64 = 50000000; +pub const MAX_TASK_NS: u128 = 50000000; /// 10 second window const INTERACTIVE_WINDOW_SECONDS: Duration = Duration::from_secs(10); diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 2e934217815..0d216212257 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1726,7 +1726,7 @@ impl ScriptThread { let task_duration = start.elapsed(); for (doc_id, doc) in self.documents.borrow().iter() { if let Some(pipeline_id) = pipeline_id { - if pipeline_id == doc_id && task_duration.as_nanos() > MAX_TASK_NS.into() { + if pipeline_id == doc_id && task_duration.as_nanos() > MAX_TASK_NS { if self.print_pwm { println!( "Task took longer than max allowed ({:?}) {:?}",