fn new(slot_duration: u64) -> Result<Self, Error> {
        let now = SystemTime::now();
        let duration = now
            .duration_since(SystemTime::UNIX_EPOCH)
            .map_err(|err| Error::StringError(format!("{}", err)))?;
        Ok(Self {
            time: atomic::AtomicU64::new(duration.as_millis() as u64),
            slot_duration,
        })
    }
/// create a new mocked time stamp provider.
create a new mocked time stamp provider.
create a new mocked time stamp provider .
fn new(slot_duration: u64) -> Result<Self, Error> {
        let now = SystemTime::now();
        let duration = now
            .duration_since(SystemTime::UNIX_EPOCH)
            .map_err(|err| Error::StringError(format!("{}", err)))?;
        Ok(Self {
            time: atomic::AtomicU64::new(duration.as_millis() as u64),
            slot_duration,
        })
    }
fn new ( slot_duration : u64 ) -> Result < Self , Error > { let now = SystemTime :: now ( ) ; let duration = now . duration_since ( SystemTime :: UNIX_EPOCH ) . map_err ( | err | Error :: StringError ( format ! ( " " err ) ) ) ? ; Ok ( Self { time : atomic :: AtomicU64 :: new ( duration . as_millis ( ) as u64 ) , slot_duration , } ) }
create a new mocked time stamp provider.
create a new mocked time stamp provider .
slot_duration
u64
slot_duration
u64