Index: base/run_loop.cc |
diff --git a/base/run_loop.cc b/base/run_loop.cc |
index 8344aa41b1631f6946e242e9ef0efbafdee23279..e92e110f82149c39ff9e9dfe2cf6552389028c12 100644 |
--- a/base/run_loop.cc |
+++ b/base/run_loop.cc |
@@ -5,6 +5,7 @@ |
#include "base/run_loop.h" |
#include "base/bind.h" |
+#include "base/tracked_objects.h" |
#if defined(OS_WIN) |
#include "base/message_loop/message_pump_dispatcher.h" |
@@ -46,7 +47,13 @@ RunLoop::~RunLoop() { |
void RunLoop::Run() { |
if (!BeforeRun()) |
return; |
+ |
+ // Use task stopwatch to exclude the loop run time from the current task, if |
+ // any. |
+ tracked_objects::TaskStopwatch stopwatch; |
loop_->RunHandler(); |
+ stopwatch.Stop(); |
+ |
AfterRun(); |
} |