pub struct HighResTimeStamp(pub f64);Expand description
Representation of DOMHighResTimeStamp.
Can be converted to the SystemTime with millisecond-wise accuracy.
HighResTimeStamp type is a f64 and is used to store a time value
in milliseconds. This type can be used to describe a discrete point in time
or a time interval (the difference in time between two discrete points in
time).
The time, given in milliseconds, should be accurate to 5 µs (microseconds), with the fractional part of the number indicating fractions of a millisecond. However, if the browser is unable to provide a time value accurate to 5 µs (due, for example, to hardware or software constraints), the browser can represent the value as a time in milliseconds accurate to a millisecond. Also note the section below on reduced time precision controlled by browser preferences to avoid timing attacks and fingerprinting.
Further, if the device or operating system the user agent is running on doesn’t have a clock accurate to the microsecond level, they may only be accurate to the millisecond.
Tuple Fields§
§0: f64Trait Implementations§
Source§impl Clone for HighResTimeStamp
impl Clone for HighResTimeStamp
Source§fn clone(&self) -> HighResTimeStamp
fn clone(&self) -> HighResTimeStamp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HighResTimeStamp
impl Debug for HighResTimeStamp
Source§impl<'de> Deserialize<'de> for HighResTimeStamp
impl<'de> Deserialize<'de> for HighResTimeStamp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<HighResTimeStamp> for SystemTime
impl From<HighResTimeStamp> for SystemTime
Source§fn from(timestamp: HighResTimeStamp) -> Self
fn from(timestamp: HighResTimeStamp) -> Self
Source§impl Hash for HighResTimeStamp
Hashing string representation.
impl Hash for HighResTimeStamp
Hashing string representation.
Some people believe that such behavior is incorrect (but in some programming
languages this is a default behavior) due to NaN, Inf or -Inf (they
all will have the same hashes).
But in the case of RtcStat received from the client, there should be no
such situations, and the hash will always be correct.
Source§impl PartialEq for HighResTimeStamp
Comparison string representations.
impl PartialEq for HighResTimeStamp
Comparison string representations.
Such implementation is required, so that the results of comparing values and comparing hashes match.