pub struct JobTimer { /* private fields */ }Expand description
Tracks time for jobs that run on many threads.
Meant for use with a threadpool. For example, build timing for each unit of work submitted to something like rayon and accumulate them here.
Currently not threadsafe, meant to be used by a central orchestrator because that happens to be what fontc does.
Implementations§
Source§impl JobTimer
impl JobTimer
Sourcepub fn create_timer(&self, id: AnyWorkId, nth_wave: usize) -> JobTime
pub fn create_timer(&self, id: AnyWorkId, nth_wave: usize) -> JobTime
Start timing a job.
Meant to be called when a job is runnable, that is it’s ready to be submitted to an execution system such as a threadpool.
nth_wave shows on mouseover in the final output. Each time we release a group of jobs - because their dependencies are complate - we increment it so one can see the graph progression in the timing svg output.
pub fn add(&mut self, timing: JobTime)
pub fn write_svg(&mut self, out: &mut impl Write) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JobTimer
impl RefUnwindSafe for JobTimer
impl Send for JobTimer
impl Sync for JobTimer
impl Unpin for JobTimer
impl UnwindSafe for JobTimer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.