Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ff6008e7 authored by Jack He's avatar Jack He
Browse files

StopWatch: Declare a stop_watch variable while timing

* A variable is needed to hold the reference of stop watch
  in the current scope. The variable will be freed once the
  current scope exits
* Without such a variable, the constructed stopwatch will only
  exist as a temporary stack variable and freed immediately
  after the declaration line, making the stop watch only timing
  the time needed for construction and immediate destruction.
  As result, current stop watch all show very minimum durations.
* Commands used:
  * find ./ -type f -exec sed -i 's/StopWatchLegacy(__func__);/StopWatchLegacy stop_watch(__func__);/g' {} \;
  * find ./ -type f -exec sed -i 's/common::StopWatch(/common::StopWatch stop_watch(/g' {} \;

Bug: 207608879
Test: GD presubmit and make
Tag: #gd-refactor
Change-Id: Ia38cf3d1473f750c6a08ba4d6551d7fafba4345a
parent ea93c89d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment