LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::TimeUtils Class Reference

This class contains utility functions to log informations about time, such as logging time elapsed since a specific moment. More...

#include <common/time/traceUtils.h>

Public Member Functions

 TimeUtils ()
 
 ~TimeUtils ()
 

Static Public Member Functions

static void updateCurrentTime (const std::string &taskCategory=std::string(""))
 store current time for new elapsed time computation
 
static void setCurrentTime (uint64_t time, const std::string &taskCategory=std::string(""))
 
static uint64_t elapsedTime (const std::string &taskCategory=std::string(""))
 
static uint64_t diffTime (const uint64_t &begin, const uint64_t &end)
 return the difference between two times in microseconds
 
static void logElapsedTime (const std::string &mess, const std::string &taskCategory=std::string(""))
 log the number of microseconds since last UpdateCurrentTime
 
static void logCumulatedTime (const std::string &mess, const std::string &taskCategory=std::string(""))
 log the number of microseconds cumulated for the category sum of elapsed time between consecutive call of UpdateCurrent() and elapsedTime()
 
static void logAllCumulatedTime (const std::string &mess)
 log the number of microseconds cumulated for all categories
 
static uint64_t getCurrentTime ()
 get the current time (real current time, not last time stored)
 

Detailed Description

This class contains utility functions to log informations about time, such as logging time elapsed since a specific moment.

It uses the logging facility: set the TimeInfo category to INFO to view the time logs.

Note
this class is deprecated to count the time passed in a specific class. Use TimeUtilsController instead.

Definition at line 41 of file traceUtils.h.

Constructor & Destructor Documentation

◆ TimeUtils()

Lima::TimeUtils::TimeUtils ( )
inline

Definition at line 44 of file traceUtils.h.

◆ ~TimeUtils()

Lima::TimeUtils::~TimeUtils ( )
inline

Definition at line 45 of file traceUtils.h.

Member Function Documentation

◆ diffTime()

uint64_t Lima::TimeUtils::diffTime ( const uint64_t &  begin,
const uint64_t &  end 
)
static

return the difference between two times in microseconds

Definition at line 51 of file traceUtils.cpp.

◆ elapsedTime()

uint64_t Lima::TimeUtils::elapsedTime ( const std::string &  taskCategory = std::string(""))
static
Note
this class is deprecated to count the time passed in a specific class. Use TimeUtilsController instead.
Returns
the number of microseconds since last UpdateCurrentTime

Definition at line 56 of file traceUtils.cpp.

◆ getCurrentTime()

uint64_t Lima::TimeUtils::getCurrentTime ( )
static

get the current time (real current time, not last time stored)

Definition at line 32 of file traceUtils.cpp.

◆ logAllCumulatedTime()

void Lima::TimeUtils::logAllCumulatedTime ( const std::string &  mess)
static

log the number of microseconds cumulated for all categories

Note
this class is deprecated to count the time passed in a specific class. Use TimeUtilsController instead.

Definition at line 82 of file traceUtils.cpp.

◆ logCumulatedTime()

void Lima::TimeUtils::logCumulatedTime ( const std::string &  mess,
const std::string &  taskCategory = std::string("") 
)
static

log the number of microseconds cumulated for the category sum of elapsed time between consecutive call of UpdateCurrent() and elapsedTime()

log the number of microseconds since last UpdateCurrentTime

Note
this class is deprecated to count the time passed in a specific class. Use TimeUtilsController instead.

Definition at line 76 of file traceUtils.cpp.

◆ logElapsedTime()

void Lima::TimeUtils::logElapsedTime ( const std::string &  mess,
const std::string &  taskCategory = std::string("") 
)
static

log the number of microseconds since last UpdateCurrentTime

Note
this class is deprecated to count the time passed in a specific class. Use TimeUtilsController instead.

Definition at line 67 of file traceUtils.cpp.

◆ setCurrentTime()

void Lima::TimeUtils::setCurrentTime ( uint64_t  time,
const std::string &  taskCategory = std::string("") 
)
static

Definition at line 46 of file traceUtils.cpp.

◆ updateCurrentTime()

void Lima::TimeUtils::updateCurrentTime ( const std::string &  taskCategory = std::string(""))
static

store current time for new elapsed time computation

Note
this class is deprecated to count the time passed in a specific class. Use TimeUtilsController instead.

Definition at line 36 of file traceUtils.cpp.


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