Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Each thread has a stack of `CodeTimer`, with the top of the stack being available anywhere via a call to `CodeTimer.get()`. When a different timer is needed for a section of code, `CodeTimer.using()` will push a new timer onto the stack, and pop it off the stack when the timed code completes, restoring the previous timer. `CodeTimer.using()` also takes care of enabling the new timer based on `AppState.isCollectProfilingData()`, and reporting the results at the end if the timer is enabled. This saves some repeated logic and adds a bit of consistency in how timers are used.
- Loading branch information