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:
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)
|
||||
{
|
||||
if (!name.empty())
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user