clangtidy corrections part 2
This commit is contained in:
+42
-41
@@ -4,9 +4,9 @@
|
||||
* @brief Inherits a class to measure times of functions.
|
||||
* @version 0.1
|
||||
* @date 2021-12-13
|
||||
*
|
||||
*
|
||||
* @copyright Copyright (c) 2021
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DEBUG_TIMES_H
|
||||
@@ -20,57 +20,58 @@
|
||||
|
||||
/**
|
||||
* @brief A class to measure times of functions.
|
||||
*
|
||||
*
|
||||
* This simple class only save the value of the millis()
|
||||
* function when you call the constructor or restart().
|
||||
* To get the elapsed time call stop() or stopConsol().
|
||||
*
|
||||
*
|
||||
* @warning This class is not very accurate
|
||||
* It only give you the time in milliseconds.
|
||||
*/
|
||||
class DebugTimes {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Debug Times object
|
||||
* Starts to count milliseconds
|
||||
*/
|
||||
class DebugTimes
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Debug Times object
|
||||
* Starts to count milliseconds
|
||||
*/
|
||||
|
||||
DebugTimes();
|
||||
/**
|
||||
* @brief Set the counter to 0
|
||||
*/
|
||||
DebugTimes();
|
||||
/**
|
||||
* @brief Set the counter to 0
|
||||
*/
|
||||
|
||||
void restart();
|
||||
void restart();
|
||||
|
||||
/**
|
||||
* @brief Give the elapsed time
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
uint16_t stop();
|
||||
/**
|
||||
* @brief Give the elapsed time
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
const uint16_t stop();
|
||||
|
||||
/**
|
||||
* @brief Print the elapsed time to consol
|
||||
*
|
||||
* @param name Functionname to print
|
||||
* @param minTime A minimum time before printing
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
uint16_t stopConsol(const char* name, uint16_t minTime = 0);
|
||||
/**
|
||||
* @brief Print the elapsed time to consol
|
||||
*
|
||||
* @param name Functionname to print
|
||||
* @param minTime A minimum time before printing
|
||||
*
|
||||
* @return uint16_t elapsed milliseconds
|
||||
*/
|
||||
const uint16_t stopConsol(const char *name, uint16_t minTime = 0);
|
||||
|
||||
/**
|
||||
* @brief Sets if the result should be printed.
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
static void setConsolOutput(bool enable);
|
||||
/**
|
||||
* @brief Sets if the result should be printed.
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
static void setConsolOutput(bool enable);
|
||||
|
||||
private:
|
||||
uint64_t startTime;
|
||||
private:
|
||||
uint64_t startTime;
|
||||
|
||||
static bool print;
|
||||
static bool printWarning;
|
||||
static bool print;
|
||||
static bool printWarning;
|
||||
};
|
||||
|
||||
#endif //DEBUG_TIMES_H
|
||||
#endif // DEBUG_TIMES_H
|
||||
|
||||
Reference in New Issue
Block a user