pub fn microseconds_now() -> Result<u64, NotRunning> {
    // Safety explanation:
    // This function can be called from any context, and it may be preempted by other interrupts.
    // It reads INITIALIZED, OVERFLOW_COUNT and the cnt register of the timer.
    //
    // Part 1: INITIALIZED
    // The only place INITIALIZED is written is in the init() function, in an interrupt-free
    // section.
    //
    // Part 2: OVERFLOW_COUNT
    // OVERFLOW_COUNT is read here and read/modified/written in handle_timer_overflow(). This is
    // a possible data race between reading the value here and writing the incremented value in
    // handle_timer_overflow(). However, because of the interrupt priority requirement, this
    // function cannot execute between the timer overflowing and handle_timer_overflow() returning.
    //
    // Part 3: Timer.cnt
    // If INITIALIZED is true, init() was called and given a Timer, so no other code can access
    // the timer. This function accesses only the cnt register, which no other code in this library
    // accesses.

    if unsafe { INITIALIZED } {
        let timer = unsafe { &*Timer::ptr() };
        let overflow_count = unsafe { OVERFLOW_COUNT };
        let microseconds_since_overflow = timer.cnt.read().cnt().bits();
        let time = (u64::from(overflow_count) << 16) | u64::from(microseconds_since_overflow);
        Ok(time)
    } else {
        Err(NotRunning(()))
    }
}
/// Returns the number of microseconds since the clock was started
///
/// This value has a capacity of 48 bits. It will overflow after approximately 8 years.
///
/// If the clock has not been started, this function returns an error.
Returns the number of microseconds since the clock was started
This value has a capacity of 48 bits. It will overflow after approximately 8 years.

If the clock has not been started, this function returns an error.
Returns the number of microseconds since the clock was started This value has a capacity of 48 bits . It will overflow after approximately 8 years . If the clock has not been started this function returns an error .
pub fn microseconds_now() -> Result<u64, NotRunning> {
    // Safety explanation:
    // This function can be called from any context, and it may be preempted by other interrupts.
    // It reads INITIALIZED, OVERFLOW_COUNT and the cnt register of the timer.
    //
    // Part 1: INITIALIZED
    // The only place INITIALIZED is written is in the init() function, in an interrupt-free
    // section.
    //
    // Part 2: OVERFLOW_COUNT
    // OVERFLOW_COUNT is read here and read/modified/written in handle_timer_overflow(). This is
    // a possible data race between reading the value here and writing the incremented value in
    // handle_timer_overflow(). However, because of the interrupt priority requirement, this
    // function cannot execute between the timer overflowing and handle_timer_overflow() returning.
    //
    // Part 3: Timer.cnt
    // If INITIALIZED is true, init() was called and given a Timer, so no other code can access
    // the timer. This function accesses only the cnt register, which no other code in this library
    // accesses.
    if unsafe { INITIALIZED } {
        let timer = unsafe { &*Timer::ptr() };
        let overflow_count = unsafe { OVERFLOW_COUNT };
        let microseconds_since_overflow = timer.cnt.read().cnt().bits();
        let time = (u64::from(overflow_count) << 16) | u64::from(microseconds_since_overflow);
        Ok(time)
    } else {
        Err(NotRunning(()))
    }
}
pub fn microseconds_now ( ) -> Result < u64 , NotRunning > { // Safety explanation: // This function can be called from any context, and it may be preempted by other interrupts. // It reads INITIALIZED, OVERFLOW_COUNT and the cnt register of the timer. // // Part 1: INITIALIZED // The only place INITIALIZED is written is in the init() function, in an interrupt-free // section. // // Part 2: OVERFLOW_COUNT // OVERFLOW_COUNT is read here and read/modified/written in handle_timer_overflow(). This is // a possible data race between reading the value here and writing the incremented value in // handle_timer_overflow(). However, because of the interrupt priority requirement, this // function cannot execute between the timer overflowing and handle_timer_overflow() returning. // // Part 3: Timer.cnt // If INITIALIZED is true, init() was called and given a Timer, so no other code can access // the timer. This function accesses only the cnt register, which no other code in this library // accesses. if unsafe { INITIALIZED } { let timer = unsafe { & * Timer :: ptr ( ) } ; let overflow_count = unsafe { OVERFLOW_COUNT } ; let microseconds_since_overflow = timer . cnt . read ( ) . cnt ( ) . bits ( ) ; let time = ( u64 :: from ( overflow_count ) << 16 ) | u64 :: from ( microseconds_since_overflow ) ; Ok ( time ) } else { Err ( NotRunning ( ( ) ) ) } }
Returns the number of microseconds since the clock was started
This value has a capacity of 48 bits.
Returns the number of microseconds since the clock was started This value has a capacity of 48 bits .