diff options
Diffstat (limited to 'libs/hwui/utils/Timing.h')
-rw-r--r-- | libs/hwui/utils/Timing.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libs/hwui/utils/Timing.h b/libs/hwui/utils/Timing.h index 4b1fabe42c35..978c7bcf7a57 100644 --- a/libs/hwui/utils/Timing.h +++ b/libs/hwui/utils/Timing.h @@ -22,18 +22,16 @@ #define TIME_METHOD() MethodTimer __method_timer(__func__) class MethodTimer { public: - explicit MethodTimer(const char* name) - : mMethodName(name) { - gettimeofday(&mStart, nullptr); - } + explicit MethodTimer(const char* name) : mMethodName(name) { gettimeofday(&mStart, nullptr); } ~MethodTimer() { struct timeval stop; gettimeofday(&stop, nullptr); - long long elapsed = (stop.tv_sec * 1000000) - (mStart.tv_sec * 1000000) - + (stop.tv_usec - mStart.tv_usec); + long long elapsed = (stop.tv_sec * 1000000) - (mStart.tv_sec * 1000000) + + (stop.tv_usec - mStart.tv_usec); ALOGD("%s took %.2fms", mMethodName, elapsed / 1000.0); } + private: const char* mMethodName; struct timeval mStart; |