pub struct GpuTimestamp {
pub start_ns: u64,
pub end_ns: u64,
}Expand description
GPU hardware timestamp pair (start / end), feature-gated to wgpu-backend.
In production use, these values are read back from a wgpu::QuerySet of
type Timestamp after the GPU has signalled completion. The raw values
are in nanoseconds (after scaling by the adapter’s timestamp period).
Fields§
§start_ns: u64Raw GPU timestamp at the start of the pass (nanoseconds).
end_ns: u64Raw GPU timestamp at the end of the pass (nanoseconds).
Implementations§
Source§impl GpuTimestamp
impl GpuTimestamp
Sourcepub fn elapsed_ns(&self) -> u64
pub fn elapsed_ns(&self) -> u64
Elapsed GPU time in nanoseconds (saturating subtraction).
Sourcepub fn elapsed_ms(&self) -> f64
pub fn elapsed_ms(&self) -> f64
Elapsed GPU time in milliseconds.
Trait Implementations§
Source§impl Clone for GpuTimestamp
impl Clone for GpuTimestamp
Source§fn clone(&self) -> GpuTimestamp
fn clone(&self) -> GpuTimestamp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GpuTimestamp
impl Debug for GpuTimestamp
Source§impl Default for GpuTimestamp
impl Default for GpuTimestamp
Source§fn default() -> GpuTimestamp
fn default() -> GpuTimestamp
Returns the “default value” for a type. Read more
impl Copy for GpuTimestamp
Auto Trait Implementations§
impl Freeze for GpuTimestamp
impl RefUnwindSafe for GpuTimestamp
impl Send for GpuTimestamp
impl Sync for GpuTimestamp
impl Unpin for GpuTimestamp
impl UnsafeUnpin for GpuTimestamp
impl UnwindSafe for GpuTimestamp
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more