Chromium Code Reviews| Index: runtime/vm/timeline.cc |
| diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc |
| index 54735a033f58610559c46398fb94394358fb0200..4284ff28ff87236862c0ab56fcd1173d4370b08d 100644 |
| --- a/runtime/vm/timeline.cc |
| +++ b/runtime/vm/timeline.cc |
| @@ -887,8 +887,10 @@ TimelineDurationScope::TimelineDurationScope(TimelineStream* stream, |
| if (!FLAG_support_timeline) { |
| return; |
| } |
| - timestamp_ = OS::GetCurrentMonotonicMicros(); |
| - thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); |
| + if (enabled()) { |
| + timestamp_ = OS::GetCurrentMonotonicMicros(); |
| + thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); |
| + } |
| } |
| @@ -899,8 +901,10 @@ TimelineDurationScope::TimelineDurationScope(Thread* thread, |
| if (!FLAG_support_timeline) { |
|
Ivan Posva
2016/05/12 18:47:46
if (!FLAG_support_timeline || !enabled()) {
Cutch
2016/05/12 20:06:22
Done.
|
| return; |
| } |
| - timestamp_ = OS::GetCurrentMonotonicMicros(); |
| - thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); |
| + if (enabled()) { |
| + timestamp_ = OS::GetCurrentMonotonicMicros(); |
| + thread_timestamp_ = OS::GetCurrentThreadCPUMicros(); |
| + } |
| } |