hlcc 2.0.0-beta2+pre1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
SimScripts.execution_statistics.ExecTimeStats Class Reference

Class used to help measure program execution time, it ca acquire the results of multiple execution iterations and produce statistics about the results and format data to be printed. More...

Public Member Functions

def __init__ (self, p_name, p_buf_size)
 Constructor.
 
def get_name (self)
 Return the name of the instance.
 
def timer_start (self)
 A call to this method should be placed in the beginning of the code we want to monitor.
 
def timer_stop (self)
 A call to this method should be placed in the end of the code we want to monitor.
 
def get_stats_data (self)
 Compute statistics from the data in the buffer and return results.
 
def print_stats (self)
 Print the statistics of the current instance.
 
def duration_as_string (self, time_ns)
 Convert a time in ns given as a uint64_t to the best string representation.
 

Public Attributes

 stats_name
 
 buf_elapsed_ns
 
 start_ns
 
 stop_ns
 

Detailed Description

Class used to help measure program execution time, it ca acquire the results of multiple execution iterations and produce statistics about the results and format data to be printed.

Constructor & Destructor Documentation

◆ __init__()

def SimScripts.execution_statistics.ExecTimeStats.__init__ (   self,
  p_name,
  p_buf_size 
)

Constructor.

Parameters
p_namestring, with the name of current instance
p_buf_sizeint with the buffer size. Once the buffer is full older data will be overwritten with new data.

Member Function Documentation

◆ duration_as_string()

def SimScripts.execution_statistics.ExecTimeStats.duration_as_string (   self,
  time_ns 
)

Convert a time in ns given as a uint64_t to the best string representation.

◆ get_name()

def SimScripts.execution_statistics.ExecTimeStats.get_name (   self)

Return the name of the instance.

◆ get_stats_data()

def SimScripts.execution_statistics.ExecTimeStats.get_stats_data (   self)

Compute statistics from the data in the buffer and return results.

Returns
s dict, with statistics data.

◆ print_stats()

def SimScripts.execution_statistics.ExecTimeStats.print_stats (   self)

Print the statistics of the current instance.

Returns
s string, with statistics data formatted to print on the screen.

◆ timer_start()

def SimScripts.execution_statistics.ExecTimeStats.timer_start (   self)

A call to this method should be placed in the beginning of the code we want to monitor.

There should only be one call to this method per instance.

◆ timer_stop()

def SimScripts.execution_statistics.ExecTimeStats.timer_stop (   self)

A call to this method should be placed in the end of the code we want to monitor.

There should only be one call to this method per instance.

Member Data Documentation

◆ buf_elapsed_ns

SimScripts.execution_statistics.ExecTimeStats.buf_elapsed_ns

◆ start_ns

SimScripts.execution_statistics.ExecTimeStats.start_ns

◆ stats_name

SimScripts.execution_statistics.ExecTimeStats.stats_name

◆ stop_ns

SimScripts.execution_statistics.ExecTimeStats.stop_ns

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