Skip to main content

profile_system_time

Function profile_system_time 

pub fn profile_system_time<B, O>(
    device: &<B as BackendTypes>::Device,
    func: impl FnOnce() -> O + Send,
) -> Result<(O, ProfileDuration), ExecutionError>
where B: Backend, O: Send + 'static,
Expand description

Measure func in wall-clock time between two syncs of device.

What a backend with no device clock reports: the default of Backend::profile, and what a backend that forwards its windows falls back to when the backend behind it opens none. The syncs are what make the number mean something, so unlike a device window this waits, and an inner window’s syncs are charged to the outer.