skia2/tools/timer/Timer.h
Jim Van Verth 32bbf377e6 Fix TSAN issue with atlas expansion.
Removes SkString-related malloc from DM crash handler, and adds null check in ProxyRefTest.

Bug: skia:3550
Change-Id: I143c532b5d231a426b1a96b854e1effd6379b673
Reviewed-on: https://skia-review.googlesource.com/48440
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-20 17:46:59 +00:00

28 lines
544 B
C++

/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef Timer_DEFINED
#define Timer_DEFINED
#include "SkString.h"
#include "SkTime.h"
#include "SkTypes.h"
class WallTimer {
public:
WallTimer() : fWall(-1) {}
void start() { fWall = SkTime::GetNSecs(); }
void end() { fWall = (SkTime::GetNSecs() - fWall) * 1e-6; }
double fWall; // Milliseconds.
};
SkString HumanizeMs(double);
int HumanizeMs(char*, int len, double);
#endif