diff options
author | Kurt Zenker <kz@openoffice.org> | 2001-03-13 14:27:02 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2001-03-13 14:27:02 +0000 |
commit | 828a2052af4fc2075c86f4dca2dc7a484737f7cf (patch) | |
tree | ef84daee3dfb6503bf0246d6f151c05f1dfea9c1 /configmgr | |
parent | a7b769c7090217bbdc5dd45c0b85943ac6c43281 (diff) |
use ftime() for windows
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/inc/tracer.hxx | 16 | ||||
-rw-r--r-- | configmgr/source/misc/tracer.cxx | 24 |
2 files changed, 35 insertions, 5 deletions
diff --git a/configmgr/source/inc/tracer.hxx b/configmgr/source/inc/tracer.hxx index caf37f184a18..524fa406cdcc 100644 --- a/configmgr/source/inc/tracer.hxx +++ b/configmgr/source/inc/tracer.hxx @@ -2,9 +2,9 @@ * * $RCSfile: tracer.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: pluby $ $Date: 2001-03-11 02:16:12 $ + * last change: $Author: kz $ $Date: 2001-03-13 15:27:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,7 +78,12 @@ #include <stdarg.h> #include <stdio.h> + +#ifdef WNT +#include <sys/timeb.h> +#else #include <sys/time.h> +#endif #define OUSTRING2ASCII(rtlOUString) ::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), RTL_TEXTENCODING_ASCII_US).getStr() @@ -103,7 +108,11 @@ class OConfigTracer protected: static ::osl::Mutex s_aMutex; static OTracerSetup* s_pImpl; +#ifdef WNT + static timeb s_aStartTime; +#else static timeval s_aStartTime; +#endif private: OConfigTracer(); // never implemented, no instantiation of this class allowed, only static members @@ -161,6 +170,9 @@ public: //************************************************************************** // history: // $Log: not supported by cvs2svn $ +// Revision 1.3 2001/03/11 02:16:12 pluby +// Replaced ftime() calls with gettimeofday() since ftime() is obsolete on Linux and Mac OS X +// // Revision 1.2 2001/02/13 09:47:14 dg // #83239# timing output // diff --git a/configmgr/source/misc/tracer.cxx b/configmgr/source/misc/tracer.cxx index e1bf802c71a8..49676edf607b 100644 --- a/configmgr/source/misc/tracer.cxx +++ b/configmgr/source/misc/tracer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tracer.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: pluby $ $Date: 2001-03-11 02:16:13 $ + * last change: $Author: kz $ $Date: 2001-03-13 15:26:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -152,23 +152,38 @@ struct OTracerSetup //========================================================================== ::osl::Mutex OConfigTracer::s_aMutex; OTracerSetup* OConfigTracer::s_pImpl = NULL; +#ifdef WNT +timeb OConfigTracer::s_aStartTime; +#else timeval OConfigTracer::s_aStartTime; - +#endif //-------------------------------------------------------------------------- void OConfigTracer::startGlobalTimer() { +#ifdef WNT + ftime( &s_aStartTime ); +#else gettimeofday( &s_aStartTime, NULL ); +#endif } //-------------------------------------------------------------------------- sal_uInt32 OConfigTracer::getGlobalTimer() { +#ifdef WNT + struct timeb currentTime; + sal_uInt32 nSeconds; + ftime( ¤tTime ); + nSeconds = (sal_uInt32)( currentTime.time - s_aStartTime.time ); + return ( nSeconds * 1000 ) + (long)( currentTime.millitm - s_aStartTime.millitm ); +#else struct timeval currentTime; sal_uInt32 nSeconds; gettimeofday( ¤tTime, NULL ); nSeconds = (sal_uInt32)( currentTime.tv_sec - s_aStartTime.tv_sec ); return ( nSeconds * 1000 ) + (long)( currentTime.tv_usec - s_aStartTime.tv_usec ); +#endif } //-------------------------------------------------------------------------- @@ -521,6 +536,9 @@ void OConfigTracer::implTrace(const sal_Char* _pType, const sal_Char* _pFormat, //************************************************************************** // history: // $Log: not supported by cvs2svn $ +// Revision 1.7 2001/03/11 02:16:13 pluby +// Replaced ftime() calls with gettimeofday() since ftime() is obsolete on Linux and Mac OS X +// // Revision 1.6 2001/02/27 14:27:25 jb // Correction: Do not print the message type twice // |