chore(examples): add examples to docs

Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren
2024-11-07 10:48:38 +01:00
parent e19b724673
commit 1d1c0e9da7
4 changed files with 43 additions and 0 deletions

View File

@@ -5,6 +5,16 @@ use std::time::Instant;
/// This is a simple wrapper around `std::time::Instant` that provides a
/// convenient way to get the seconds elapsed since the creation of the
/// `Timebase` instance.
///
/// # Examples
///
/// ```
/// use rosenpass_util::time::Timebase;
///
/// let timebase = Timebase::default();
/// let now = timebase.now();
/// assert!(now > 0.0);
/// ```
#[derive(Clone, Debug)]
pub struct Timebase(Instant);