Cycles: Add utility function to query current value of scoped timer

This commit is contained in:
Sergey Sharybin 2017-08-25 14:15:51 +02:00
parent 12d527f327
commit 90299e4216

@ -37,7 +37,7 @@ public:
~scoped_timer() ~scoped_timer()
{ {
if(value_ != NULL) { if(value_ != NULL) {
*value_ = time_dt() - time_start_; *value_ = get_time();
} }
} }
@ -46,6 +46,11 @@ public:
return time_start_; return time_start_;
} }
double get_time() const
{
return time_dt() - time_start_;
}
protected: protected:
double *value_; double *value_;
double time_start_; double time_start_;