Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: rrtimer.h

Issue 1953443002: Update to libjpeg_turbo 1.4.90 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « rdtarga.c ('k') | rrutil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rrtimer.h
diff --git a/rrtimer.h b/rrtimer.h
deleted file mode 100644
index 4db5e371895a6669d63332bb04eb58288b4ad2fa..0000000000000000000000000000000000000000
--- a/rrtimer.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright (C)2004 Landmark Graphics Corporation
- * Copyright (C)2005 Sun Microsystems, Inc.
- *
- * This library is free software and may be redistributed and/or modified under
- * the terms of the wxWindows Library License, Version 3.1 or (at your option)
- * any later version. The full license is in the LICENSE.txt file included
- * with this distribution.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * wxWindows Library License for more details.
- */
-
-#ifndef __RRTIMER_H__
-#define __RRTIMER_H__
-
-#ifdef __cplusplus
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <sys/time.h>
-#endif
-
-class rrtimer
-{
- public:
-
- rrtimer(void) : t1(0.0)
- {
- #ifdef _WIN32
- highres=false; tick=0.001;
- LARGE_INTEGER Frequency;
- if(QueryPerformanceFrequency(&Frequency)!=0)
- {
- tick=(double)1.0/(double)(Frequency.QuadPart);
- highres=true;
- }
- #endif
- }
-
- void start(void)
- {
- t1=time();
- }
-
- double time(void)
- {
- #ifdef _WIN32
- if(highres)
- {
- LARGE_INTEGER Time;
- QueryPerformanceCounter(&Time);
- return((double)(Time.QuadPart)*tick);
- }
- else
- return((double)GetTickCount()*tick);
- #else
- struct timeval __tv;
- gettimeofday(&__tv, (struct timezone *)NULL);
- return((double)(__tv.tv_sec)+(double)(__tv.tv_usec)*0.000001);
- #endif
- }
-
- double elapsed(void)
- {
- return time()-t1;
- }
-
- private:
-
- #ifdef _WIN32
- bool highres; double tick;
- #endif
- double t1;
-};
-
-#endif // __cplusplus
-
-#ifdef _WIN32
-
-#include <windows.h>
-
-__inline double rrtime(void)
-{
- LARGE_INTEGER Frequency, Time;
- if(QueryPerformanceFrequency(&Frequency)!=0)
- {
- QueryPerformanceCounter(&Time);
- return (double)Time.QuadPart/(double)Frequency.QuadPart;
- }
- else return (double)GetTickCount()*0.001;
-}
-
-#else
-
-#include <sys/time.h>
-
-#ifdef sun
-#define __inline inline
-#endif
-
-static __inline double rrtime(void)
-{
- struct timeval __tv;
- gettimeofday(&__tv, (struct timezone *)NULL);
- return((double)__tv.tv_sec+(double)__tv.tv_usec*0.000001);
-}
-
-#endif
-
-#endif
-
« no previous file with comments | « rdtarga.c ('k') | rrutil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698