From c13ece9672379c9133877337093f74fd79492e09 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 11 Feb 2004 10:18:34 +0000 Subject: [PATCH] Added defined(__x86_64__) to force X86-64 build to use standard clock --- src/osg/Timer.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/osg/Timer.cpp b/src/osg/Timer.cpp index 1346b3584..702a2bd90 100644 --- a/src/osg/Timer.cpp +++ b/src/osg/Timer.cpp @@ -1,13 +1,13 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. - * + * * 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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ //#include @@ -40,10 +40,10 @@ const Timer* Timer::instance() Timer::Timer() { _useStandardClock = false; - + if (_useStandardClock) { - _secsPerTick = (1.0 / (double) CLOCKS_PER_SEC); + _secsPerTick = (1.0 / (double) CLOCKS_PER_SEC); } else { @@ -74,7 +74,7 @@ const Timer* Timer::instance() Timer::Timer() { _useStandardClock = false; - + if (_useStandardClock) { _secsPerTick = 1e-6; // gettimeofday()'s precision. @@ -95,8 +95,8 @@ const Timer* Timer::instance() _secsPerTick = 1.0/cpuspeed; } } - -#elif defined(__linux) + +#elif defined(__linux) #include #include @@ -105,12 +105,12 @@ const Timer* Timer::instance() Timer::Timer() { -#ifdef __ia64 +#if defined(__ia64) || defined(__x86_64__) _useStandardClock = true; #else _useStandardClock = false; #endif - + if (_useStandardClock) { _secsPerTick = 1e-6; // gettimeofday()'s precision. @@ -129,7 +129,7 @@ const Timer* Timer::instance() char *ptr = buff; while( ptr && *ptr != ':' ) ptr++; - if( ptr ) + if( ptr ) { ptr++; sscanf( ptr, "%lf", &cpu_mhz );