usestd::sync::LazyLock;usenetcore::smoltcp;/// Global lazily-initialized instance of [`StdClock`].
pubstaticCLOCK:LazyLock<StdClock>=LazyLock::new(Default::default);/// Utility type that supports producing [`smoltcp::time::Instant`] relative to an initial
/// [`std::time::Instant`].
pubstructStdClock{start:std::time::Instant,
}implStdClock{/// Construct a new clock that uses [`std::time::Instant::now`] as its base
pubfnnew()->Self{Self{
start:std::time::Instant::now(),}}/// Get the [`smoltcp::time::Instant`] corresponding to now in this clock.
pubfnnow(&self)->smoltcp::time::Instant{smoltcp::time::Instant::from_micros(self.start.elapsed().as_micros()asi64)}}implDefault forStdClock{fndefault()->Self{Self::new()}}