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"
50, m_is_activated(false)
51, m_activation_time(0.0)
76 m_activation_time = 0.;
77 m_timer_mng->beginTimer(
this);
80 m_is_activated =
true;
90 m_activation_time = m_timer_mng->endTimer(
this);
91 m_is_activated =
false;
92 m_total_time += m_activation_time;
96 return m_activation_time;
102 m_is_activated =
false;
103 m_activation_time = 0.0;
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.
virtual bool isGathering() const =0
Indicates if statistics are active.
Interface of a timer manager.
Unicode character string.
const String & name() const
Returns the name of the timer.
ITimerMng * timerMng() const
Manager associated with this timer.
Real stop()
Deactivates the timer.
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.
void start()
Activates 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.