14#include "arcane/utils/PlatformUtils.h"
15#include "arcane/utils/String.h"
16#include "arcane/utils/TraceInfo.h"
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/ITraceMng.h"
19#include "arcane/utils/Iostream.h"
21#include "arcane/core/Timer.h"
22#include "arcane/core/ISubDomain.h"
23#include "arcane/core/ITimerMng.h"
24#include "arcane/core/ITimeStats.h"
26#include "arccore/trace/internal/TimeMetric.h"
123 m_stats->beginAction(m_action_name);
130Action(ISubDomain* sub_domain,
const String& action_name,
bool print_time)
132, m_action_name(action_name)
133, m_print_time(print_time)
136 m_stats = sub_domain->timeStats();
146, m_action_name(action_name)
147, m_print_time(print_time)
159 m_stats->endAction(m_action_name, m_print_time);
172 if (!m_stats->isGathering())
175 m_stats->beginPhase(m_phase_type);
187 m_stats = sub_domain->timeStats();
209 m_stats->endPhase(m_phase_type);
218Timer::SimplePrinter::
219SimplePrinter(ITraceMng* tm,
const String& msg)
231Timer::SimplePrinter::
235, m_is_active(is_active)
244Timer::SimplePrinter::
249 Real diff_time = end_time - m_begin_time;
250 m_trace_mng->info() << m_message <<
" time=" << diff_time;
257void Timer::SimplePrinter::
267TimeMetricAction Timer::
270 ITimeMetricCollector* c =
nullptr;
272 c = s->metricCollector();
274 return TimeMetricAction();
275 return TimeMetricAction(c, TimeMetricActionBuildInfo(String(), phase));
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Interface of the subdomain manager.
Interface managing execution time statistics.
virtual bool isGathering() const =0
Indicates if statistics are active.
Interface of a timer manager.
Unicode character string.
ITimeStats * m_stats
Sub-domain manager.
const String & name() const
Returns the name of the timer.
eTimerType m_type
Timer type.
Real m_activation_time
Time spent during the last activation.
Integer m_nb_activated
Number of times the timer has been activated.
ITimerMng * timerMng() const
Manager associated with this timer.
Real stop()
Deactivates the timer.
ITimerMng * m_timer_mng
Timer manager.
eTimerType type() const
Returns the type of time used.
Timer(ISubDomain *sd, const String &name, eTimerType type)
Constructs a timer.
void reset()
Resets the time counters.
Real m_start_time
Time of the start of the last activation.
bool m_is_activated
true if the timer is active
void start()
Activates the timer.
Real m_total_time
Total time spent in the timer.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
double Real
Type representing a real number.
eTimePhase
Phase of a temporal action.