clangtidy corrections part 2
This commit is contained in:
+23
-12
@@ -4,42 +4,53 @@
|
||||
* @brief Implemention of the class debugTimes.h.
|
||||
* @version 0.1
|
||||
* @date 2021-12-13
|
||||
*
|
||||
*
|
||||
* @copyright Copyright (c) 2021
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include "debugTimes.h"
|
||||
|
||||
bool DebugTimes::print = false;
|
||||
bool DebugTimes::printWarning = true;
|
||||
|
||||
DebugTimes::DebugTimes() {
|
||||
this->startTime = millis();
|
||||
|
||||
if (DebugTimes::printWarning) {
|
||||
std::cout << std::endl << "Warning: DebugTimes is muuted, no times are be shown." << std::endl << std::endl;
|
||||
DebugTimes::DebugTimes()
|
||||
: startTime{millis()}
|
||||
{
|
||||
if (DebugTimes::printWarning)
|
||||
{
|
||||
std::cout << std::endl
|
||||
<< "Warning: DebugTimes is muuted, no times are be shown." << std::endl
|
||||
<< std::endl;
|
||||
DebugTimes::printWarning = false;
|
||||
}
|
||||
}
|
||||
|
||||
void DebugTimes::restart() {
|
||||
void DebugTimes::restart()
|
||||
{
|
||||
this->startTime = millis();
|
||||
}
|
||||
|
||||
uint16_t DebugTimes::stop() {
|
||||
const uint16_t DebugTimes::stop()
|
||||
{
|
||||
return millis() - this->startTime;
|
||||
}
|
||||
|
||||
uint16_t DebugTimes::stopConsol(const char* name, uint16_t minTime) {
|
||||
uint64_t time = millis() - this->startTime;
|
||||
const uint16_t DebugTimes::stopConsol(const char *name, uint16_t minTime)
|
||||
{
|
||||
const uint64_t time = millis() - this->startTime;
|
||||
if (time > minTime && DebugTimes::print)
|
||||
{
|
||||
std::cout << name << " needs " << time << " ms" << std::endl;
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
void DebugTimes::setConsolOutput(bool enable) {
|
||||
void DebugTimes::setConsolOutput(bool enable)
|
||||
{
|
||||
if (enable == DebugTimes::print)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DebugTimes::print = enable;
|
||||
DebugTimes::printWarning = !enable;
|
||||
|
||||
Reference in New Issue
Block a user