libyggdrasil  v1.0.0
bsp::asg_coproc::drv::TimerProfileCounter< Context, Size > Struct Template Reference

Profile counter implementation for Midgard. More...

#include <timer.hpp>

Public Member Functions

ALWAYS_INLINE void start () const noexcept
 Start the counter. More...
 
ALWAYS_INLINE void stop () const noexcept
 Stop the counter. More...
 
ALWAYS_INLINE void reset () const noexcept
 Reset the counter to 0. More...
 
u64 getTimeToOverflow () const noexcept
 Get the time to an overflow. More...
 
std::string getFormattedTimeToOverflow () const noexcept
 Get the time to an overflow. More...
 
u64 getPassedTime () const noexcept
 Get the time passed time since the start. More...
 
std::string getFormattedPassedTime () const noexcept
 Get the time passed time since the start. More...
 
std::string formatToString (u64 passedTime) const noexcept
 Formats the passed time in ns to a string. More...
 

Detailed Description

template<auto Context, typename Size>
struct bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >

Profile counter implementation for Midgard.

Warning
Do not use this on its own!
Template Parameters
ContextTimer context
SizeTimer width (16 bit or 32 bit)

Member Function Documentation

◆ formatToString()

template<auto Context, typename Size >
std::string bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::formatToString ( u64  passedTime) const
inlinenoexcept

Formats the passed time in ns to a string.

Parameters
passedTimePassed time in nanoseconds
Returns
Time passed formatted as a string

◆ getFormattedPassedTime()

template<auto Context, typename Size >
std::string bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::getFormattedPassedTime ( ) const
inlinenoexcept

Get the time passed time since the start.

Returns
Passed time formatted as a string

◆ getFormattedTimeToOverflow()

template<auto Context, typename Size >
std::string bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::getFormattedTimeToOverflow ( ) const
inlinenoexcept

Get the time to an overflow.

Returns
Time to an overflow formatted as a string

◆ getPassedTime()

template<auto Context, typename Size >
u64 bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::getPassedTime ( ) const
inlinenoexcept

Get the time passed time since the start.

Returns
Passed time in a u64

◆ getTimeToOverflow()

template<auto Context, typename Size >
u64 bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::getTimeToOverflow ( ) const
inlinenoexcept

Get the time to an overflow.

Returns
Time to an overflow in a u64

◆ reset()

template<auto Context, typename Size >
ALWAYS_INLINE void bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::reset ( ) const
inlinenoexcept

Reset the counter to 0.

◆ start()

template<auto Context, typename Size >
ALWAYS_INLINE void bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::start ( ) const
inlinenoexcept

Start the counter.

◆ stop()

template<auto Context, typename Size >
ALWAYS_INLINE void bsp::asg_coproc::drv::TimerProfileCounter< Context, Size >::stop ( ) const
inlinenoexcept

Stop the counter.


The documentation for this struct was generated from the following file: