Introduce SystemTime to Event in iced_sentinel
This commit is contained in:
parent
8591e5a148
commit
3d90665f9d
5 changed files with 74 additions and 28 deletions
|
|
@ -48,7 +48,7 @@ pub fn time(window: window::Id, name: impl AsRef<str>) -> Timer {
|
|||
|
||||
#[cfg(feature = "enable")]
|
||||
mod internal {
|
||||
use crate::core::time::Instant;
|
||||
use crate::core::time::{Instant, SystemTime};
|
||||
use crate::core::window;
|
||||
use crate::style::theme;
|
||||
|
||||
|
|
@ -104,6 +104,7 @@ mod internal {
|
|||
Timer {
|
||||
stage,
|
||||
start: Instant::now(),
|
||||
start_system_time: SystemTime::now(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -111,12 +112,14 @@ mod internal {
|
|||
pub struct Timer {
|
||||
stage: timing::Stage,
|
||||
start: Instant,
|
||||
start_system_time: SystemTime,
|
||||
}
|
||||
|
||||
impl Timer {
|
||||
pub fn finish(self) {
|
||||
lock().sentinel.report_timing(Timing {
|
||||
stage: self.stage,
|
||||
start: self.start_system_time,
|
||||
duration: self.start.elapsed(),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue