mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Fix incorrect timing values
This commit is contained in:
parent
33e05e330e
commit
9a772539bf
2 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ public:
|
|||
private:
|
||||
bool running_ {false}; //!< is timer running?
|
||||
std::chrono::time_point<clock> start_; //!< starting point for clock
|
||||
double elapsed_; //!< elasped time in [s]
|
||||
double elapsed_ {0.0}; //!< elasped time in [s]
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ double Timer::elapsed()
|
|||
{
|
||||
if (running_) {
|
||||
std::chrono::duration<double> diff = clock::now() - start_;
|
||||
return elapsed_ += diff.count();
|
||||
return elapsed_ + diff.count();
|
||||
} else {
|
||||
return elapsed_;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue