Index: runtime/vm/timer.h |
diff --git a/runtime/vm/timer.h b/runtime/vm/timer.h |
index f3b15fafaa1013fc160b76a00a2446fce467738d..7cb218709f79bc5965a42e8558b75858443ebeb0 100644 |
--- a/runtime/vm/timer.h |
+++ b/runtime/vm/timer.h |
@@ -7,6 +7,7 @@ |
#include "platform/utils.h" |
#include "vm/allocation.h" |
+#include "vm/atomic.h" |
#include "vm/flags.h" |
#include "vm/os.h" |
@@ -65,6 +66,15 @@ class Timer : public ValueObject { |
running_ = false; |
} |
+ bool IsReset() const { |
+ return (start_ == 0) && (stop_ == 0) && (total_ == 0) && |
+ (max_contiguous_ == 0) && !running_; |
+ } |
+ |
+ void AddTotal(const Timer& other) { |
+ AtomicOperations::IncrementInt64By(&total_, other.total_); |
+ } |
+ |
// Accessors. |
bool report() const { return report_; } |
bool running() const { return running_; } |