diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-25 15:15:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-25 15:27:34 +0300 |
commit | 90299e4216fc50bfbe245c9658f3d938635982a4 (patch) | |
tree | 9d9528631825df00729c0cd741f197ef781b7301 | |
parent | 12d527f327c5f253f4cddf5db2b51abf6e1ecb6e (diff) |
Cycles: Add utility function to query current value of scoped timer
-rw-r--r-- | intern/cycles/util/util_time.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/util/util_time.h b/intern/cycles/util/util_time.h index 65798244111..f03aa590e9b 100644 --- a/intern/cycles/util/util_time.h +++ b/intern/cycles/util/util_time.h @@ -37,7 +37,7 @@ public: ~scoped_timer() { if(value_ != NULL) { - *value_ = time_dt() - time_start_; + *value_ = get_time(); } } @@ -46,6 +46,11 @@ public: return time_start_; } + double get_time() const + { + return time_dt() - time_start_; + } + protected: double *value_; double time_start_; |