OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Test.h" | 8 #include "Test.h" |
9 | 9 |
10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 } | 30 } |
31 result.append(this->condition); | 31 result.append(this->condition); |
32 return result; | 32 return result; |
33 } | 33 } |
34 | 34 |
35 SkString skiatest::GetTmpDir() { | 35 SkString skiatest::GetTmpDir() { |
36 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? nullptr : FLAGS_tmpDir[0]; | 36 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? nullptr : FLAGS_tmpDir[0]; |
37 return SkString(tmpDir); | 37 return SkString(tmpDir); |
38 } | 38 } |
| 39 |
| 40 skiatest::Timer::Timer() : fStartNanos(SkTime::GetNSecs()) {} |
| 41 |
| 42 double skiatest::Timer::elapsedNs() const { |
| 43 return SkTime::GetNSecs() - fStartNanos; |
| 44 } |
| 45 |
| 46 double skiatest::Timer::elapsedMs() const { return this->elapsedNs() * 1e-6; } |
| 47 |
| 48 SkMSec skiatest::Timer::elapsedMsInt() const { |
| 49 const double elapsedMs = this->elapsedMs(); |
| 50 SkASSERT(SK_MSecMax >= elapsedMs); |
| 51 return static_cast<SkMSec>(elapsedMs); |
| 52 } |
OLD | NEW |