[PATCH] D15619: [Support] Make llvm::Timer reusable
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 21 14:52:24 PST 2015
vsk added inline comments.
================
Comment at: include/llvm/Support/Timer.h:107
@@ +106,3 @@
+ /// hasTriggered - Check if startTimer() has ever been called on this timer.
+ bool hasTriggered() const { return TimeRecord() < StartTime; }
+
----------------
rafael wrote:
> Is this reliable? Will it return true in
>
> Foo.startTimer();
> Foo.hasTriggered();
>
> That is, if hasTriggered is called immediately after the start.
>
Yes it will return true in that scenario. I added a bool to make this clearer, and a CheckIfTriggered unit test.
http://reviews.llvm.org/D15619
More information about the llvm-commits
mailing list