mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Hadrons: direct timer access
This commit is contained in:
parent
603d59f389
commit
3c27bb36d4
@ -75,6 +75,24 @@ void ModuleBase::startTimer(const std::string &name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridTime ModuleBase::getTimer(const std::string &name)
|
||||||
|
{
|
||||||
|
GridTime t;
|
||||||
|
|
||||||
|
if (!name.empty())
|
||||||
|
{
|
||||||
|
stopTimer(name);
|
||||||
|
t = timer_.at(name).Elapsed();
|
||||||
|
startTimer(name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
t = GridTime::zero();
|
||||||
|
}
|
||||||
|
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
void ModuleBase::startCurrentTimer(const std::string &name)
|
void ModuleBase::startCurrentTimer(const std::string &name)
|
||||||
{
|
{
|
||||||
if (!name.empty())
|
if (!name.empty())
|
||||||
|
@ -165,6 +165,7 @@ public:
|
|||||||
void operator()(void);
|
void operator()(void);
|
||||||
// timers
|
// timers
|
||||||
void startTimer(const std::string &name);
|
void startTimer(const std::string &name);
|
||||||
|
GridTime getTimer(const std::string &name);
|
||||||
void startCurrentTimer(const std::string &name);
|
void startCurrentTimer(const std::string &name);
|
||||||
void stopTimer(const std::string &name);
|
void stopTimer(const std::string &name);
|
||||||
void stopCurrentTimer(void);
|
void stopCurrentTimer(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user