LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
traceUtils.h
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/************************************************************************
7 *
8 * @file traceUtils.h
9 * @author Besancon Romaric (besanconr@zoe.cea.fr)
10 * @date Fri Mar 5 2004
11 * @version $Id: traceUtils.h,v 1.3 2005/10/20 11:37:31 gael Exp $
12 * copyright Copyright (C) 2004-2012 by CEA LIST
13 * Project Linguistic Analysis
14 *
15 * @brief contains functions to trace some infos for debug
16 *
17 *
18 ***********************************************************************/
19
20#ifndef LIMA_TRACEUTILS_H
21#define LIMA_TRACEUTILS_H
22
23#include "common/LimaCommon.h"
24
25#include <QtCore/QMutex>
26
27#include <string>
28
29
30namespace Lima {
31
32 #define TIMELOGINIT LOGINIT("TimeInfo")
42 {
43 public:
46
52 // static void updateCurrentTime( const std::string& taskCategory = std::string("") );
53 static void updateCurrentTime( const std::string& taskCategory = std::string("") );
54
55 // static void setCurrentTime(uint64_t time);
56 static void setCurrentTime(uint64_t time, const std::string& taskCategory = std::string(""));
57
62 // static uint64_t elapsedTime();
63 static uint64_t elapsedTime( const std::string& taskCategory = std::string("") );
64
68 static uint64_t diffTime(const uint64_t& begin,
69 const uint64_t& end);
70
75 // void TimeUtils::logElapsedTime(const std::string& mess) {
76 static void logElapsedTime(const std::string& mess,
77 const std::string& taskCategory = std::string("") );
78
84 static void logCumulatedTime(const std::string& mess,
85 const std::string& taskCategory = std::string(""));
90 static void logAllCumulatedTime(const std::string& mess);
96 static uint64_t getCurrentTime();
97
98 private:
100 // static uint64_t currentTime;
101 static std::map<std::string , std::pair<uint64_t,uint64_t> > m_cumulatedTime;
102 static QMutex m_mutex;
103 };
104
105 } // end namespace
106
107 #endif
108
#define LIMA_TIME_EXPORT
Definition LimaCommon.h:136
This class contains utility functions to log informations about time, such as logging time elapsed si...
Definition traceUtils.h:42
NAUTITIA.