1 /* 2 * Copyright 2011 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 #ifndef Timer_DEFINED 8 #define Timer_DEFINED 9 10 #include "SkString.h" 11 #include "SkTime.h" 12 #include "SkTypes.h" 13 14 class WallTimer { 15 public: WallTimer()16 WallTimer() : fWall(-1) {} 17 start()18 void start() { fWall = SkTime::GetNSecs(); } end()19 void end() { fWall = (SkTime::GetNSecs() - fWall) * 1e-6; } 20 21 double fWall; // Milliseconds. 22 }; 23 24 SkString HumanizeMs(double); 25 int HumanizeMs(char*, int len, double); 26 27 #endif 28