File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,9 @@ impl Default for ClockType {
38
38
fn default ( ) -> Self {
39
39
#[ cfg( feature = "quanta" ) ]
40
40
{
41
- // Try to get the both origins at close to the same time. Assuming that
42
- // `quanta::Instant::now` has lower latency than `StdInstant::now`.
43
- let quanta_origin = quanta:: Instant :: now ( ) ;
44
- let std_origin = StdInstant :: now ( ) ;
45
41
return ClockType :: Hybrid {
46
- std_origin,
47
- quanta_origin,
42
+ std_origin : StdInstant :: now ( ) ,
43
+ quanta_origin : quanta :: Instant :: now ( ) ,
48
44
} ;
49
45
}
50
46
@@ -113,6 +109,9 @@ impl Clock {
113
109
}
114
110
115
111
/// Converts an `Instant` to a `std::time::Instant`.
112
+ ///
113
+ /// **IMPORTANT**: The caller must ensure that the `Instant` was created by this
114
+ /// `Clock`, otherwise the resulting `std::time::Instant` will be incorrect.
116
115
pub ( crate ) fn to_std_instant ( & self , instant : Instant ) -> StdInstant {
117
116
match & self . ty {
118
117
ClockType :: Standard { origin } => {
You can’t perform that action at this time.
0 commit comments