Flutter Engine
The Flutter Engine
third_party
skia
tools
timer
Timer.cpp
Go to the documentation of this file.
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
#include "
tools/timer/Timer.h
"
8
9
SkString
HumanizeMs
(
double
ms) {
10
if
(ms > 60
e
+3)
return
SkStringPrintf
(
"%.3gm"
, ms/60
e
+3);
11
if
(ms > 1
e
+3)
return
SkStringPrintf
(
"%.3gs"
, ms/1
e
+3);
12
if
(ms < 1
e
-3)
return
SkStringPrintf
(
"%.3gns"
, ms*1
e
+6);
13
#ifdef SK_BUILD_FOR_WIN
14
if
(ms < 1)
return
SkStringPrintf
(
"%.3gus"
, ms*1
e
+3);
15
#else
16
if
(ms < 1)
return
SkStringPrintf
(
"%.3gµs"
, ms*1
e
+3);
17
#endif
18
return
SkStringPrintf
(
"%.3gms"
, ms);
19
}
SkStringPrintf
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
HumanizeMs
SkString HumanizeMs(double ms)
Definition:
Timer.cpp:9
Timer.h
SkString
Definition:
SkString.h:118
protoc_wrapper.e
e
Definition:
protoc_wrapper.py:226
Generated on Sun Jun 23 2024 21:56:51 for Flutter Engine by
1.9.4