Fix UMA/UKM ActualLogUploadInterval metrics some more.

https://chromium-review.googlesource.com/c/chromium/src/+/1278226
attempted to fix these, but there was still an issue because
last_upload_finish_time_ was being set to TimeTicks() instead of
Now().

Bug: 894909
Change-Id: Ibacc8755e53ed6a67fa0ba5a52cea1f281f32c36
Reviewed-on: https://chromium-review.googlesource.com/c/1310639
Reviewed-by: Steven Holte <[email protected]>
Commit-Queue: Alexei Svitkine <[email protected]>
Cr-Commit-Position: refs/heads/master@{#604756}
diff --git a/components/metrics/reporting_service.cc b/components/metrics/reporting_service.cc
index cb61d660..4045492 100644
--- a/components/metrics/reporting_service.cc
+++ b/components/metrics/reporting_service.cc
@@ -99,11 +99,11 @@
   DVLOG(1) << "SendNextLog";
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
 
+  const base::TimeTicks now = base::TimeTicks::Now();
   LogActualUploadInterval(last_upload_finish_time_.is_null()
                               ? base::TimeDelta()
-                              : base::TimeTicks::Now() -
-                                    last_upload_finish_time_);
-  last_upload_finish_time_ = base::TimeTicks();
+                              : now - last_upload_finish_time_);
+  last_upload_finish_time_ = now;
 
   if (!reporting_active()) {
     upload_scheduler_->StopAndUploadCancelled();