Skip to content

Commit 9a77253

Browse files
committed
Fix incorrect timing values
1 parent 33e05e3 commit 9a77253

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/openmc/timer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Timer {
3131
private:
3232
bool running_ {false}; //!< is timer running?
3333
std::chrono::time_point<clock> start_; //!< starting point for clock
34-
double elapsed_; //!< elasped time in [s]
34+
double elapsed_ {0.0}; //!< elasped time in [s]
3535
};
3636

3737
//==============================================================================

‎src/timer.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ double Timer::elapsed()
2828
{
2929
if (running_) {
3030
std::chrono::duration<double> diff = clock::now() - start_;
31-
return elapsed_ += diff.count();
31+
return elapsed_ + diff.count();
3232
} else {
3333
return elapsed_;
3434
}

0 commit comments

Comments
 (0)