1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Hadrons: direct timer access

This commit is contained in:
Antonin Portelli 2018-08-13 20:17:45 +01:00
parent 603d59f389
commit 3c27bb36d4
2 changed files with 19 additions and 0 deletions

View File

@ -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)
{
if (!name.empty())

View File

@ -165,6 +165,7 @@ public:
void operator()(void);
// timers
void startTimer(const std::string &name);
GridTime getTimer(const std::string &name);
void startCurrentTimer(const std::string &name);
void stopTimer(const std::string &name);
void stopCurrentTimer(void);