Cycles: Add utility function to query current value of scoped timer
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 25 Aug 2017 12:15:51 +0000 (14:15 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 25 Aug 2017 12:27:34 +0000 (14:27 +0200)
intern/cycles/util/util_time.h

index 65798244111d0e6b1b77e094321aaca32b5e6f92..f03aa590e9b17c19d4299b190265f8665f894575 100644 (file)
@@ -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_;