]> git.saurik.com Git - apple/system_cmds.git/blobdiff - CPPUtil/UtilTimer.cpp
system_cmds-735.tar.gz
[apple/system_cmds.git] / CPPUtil / UtilTimer.cpp
diff --git a/CPPUtil/UtilTimer.cpp b/CPPUtil/UtilTimer.cpp
deleted file mode 100644 (file)
index b285565..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-//  UtilTimer.cpp
-//  CPPUtil
-//
-//  Created by James McIlree on 10/9/13.
-//  Copyright (c) 2013 Apple. All rights reserved.
-//
-
-#include "CPPUtil.h"
-
-BEGIN_UTIL_NAMESPACE
-
-static mach_timebase_info_data_t timebase_info;
-
-Timer::Timer(const char* message) : _message(message) {
-       // C++ guarantees that static variable initialization is thread safe.
-       // We don't actually care what the returned value is, we just want to init timebase_info
-       // The pragma prevents spurious warnings.
-       static kern_return_t blah = mach_timebase_info(&timebase_info);
-#pragma unused(blah)
-
-       _start = AbsTime::now(); // Do this after the initialization check.
-}
-
-Timer::~Timer()
-{
-       _end = AbsTime::now();
-       printf("%s: %5.5f seconds\n", _message.c_str(), (double)(_end - _start).nano_time().value() / (double)NANOSECONDS_PER_SECOND);
-}
-
-END_UTIL_NAMESPACE