Coverage Report

Created: 2024-05-20 07:14

/src/skia/tools/timer/Timer.cpp
Line
Count
Source (jump to first uncovered line)
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
0
SkString HumanizeMs(double ms) {
10
0
    if (ms > 60e+3)  return SkStringPrintf("%.3gm", ms/60e+3);
11
0
    if (ms >  1e+3)  return SkStringPrintf("%.3gs",  ms/1e+3);
12
0
    if (ms <  1e-3)  return SkStringPrintf("%.3gns", ms*1e+6);
13
#ifdef SK_BUILD_FOR_WIN
14
    if (ms < 1)      return SkStringPrintf("%.3gus", ms*1e+3);
15
#else
16
0
    if (ms < 1)      return SkStringPrintf("%.3gµs", ms*1e+3);
17
0
#endif
18
0
    return SkStringPrintf("%.3gms", ms);
19
0
}