all: fetch current time only once per iteration
This commit is contained in:
parent
d8d6be1ef3
commit
bb9e6ba3b5
21 changed files with 99 additions and 97 deletions
18
src/state.rs
18
src/state.rs
|
|
@ -60,6 +60,7 @@ use {
|
|||
scale::Scale,
|
||||
security_context_acceptor::SecurityContextAcceptors,
|
||||
theme::{Color, Theme},
|
||||
time::Time,
|
||||
tree::{
|
||||
ContainerNode, ContainerSplit, Direction, DisplayNode, FloatNode, Node, NodeIds,
|
||||
NodeVisitorBase, OutputNode, PlaceholderNode, ToplevelNode, ToplevelNodeBase,
|
||||
|
|
@ -1061,6 +1062,23 @@ impl State {
|
|||
}
|
||||
(self.dummy_output.get().unwrap(), 0, 0)
|
||||
}
|
||||
|
||||
pub fn now(&self) -> Time {
|
||||
self.eng.now()
|
||||
}
|
||||
|
||||
pub fn now_nsec(&self) -> u64 {
|
||||
self.eng.now().nsec()
|
||||
}
|
||||
|
||||
pub fn now_usec(&self) -> u64 {
|
||||
self.eng.now().usec()
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn now_msec(&self) -> u64 {
|
||||
self.eng.now().msec()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue