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

This file contains a class to control log of informations about time, such as logging cumulated time for a specific function. More...

#include <common/time/timeUtilsController.h>

Public Member Functions

 TimeUtilsController (const std::string &topic, bool logElapsedTime=false)
 
 ~TimeUtilsController ()
 

Detailed Description

This file contains a class to control log of informations about time, such as logging cumulated time for a specific function.

It uses internaly the TimeUtils class functions and static data.

How to use it:

  • at the beginning of the function/method f you want count the time it takes, declare a local variable instance i of this class with a uniq name and (optionaly) a boolean indicating if you want to log out the lifetime of the object i, thus the time spent in the function f.
  • at the end of your program main function, call the TimeUtils::logAllCumulatedTime static function.
Note
To log the time passed in the main function itself, you must declare a pointer to an object of this class, initialize it in the heap with the new operator and call delete on this object before logging the accumulated time (see hereabove)
This will not work as expected with recursive calls.
This will not work as expected in a multithreaded environment

Definition at line 45 of file timeUtilsController.h.

Constructor & Destructor Documentation

◆ TimeUtilsController()

Lima::TimeUtilsController::TimeUtilsController ( const std::string &  topic,
bool  logElapsedTime = false 
)

Definition at line 21 of file timeUtilsController.cpp.

◆ ~TimeUtilsController()

Lima::TimeUtilsController::~TimeUtilsController ( )

Definition at line 27 of file timeUtilsController.cpp.


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