diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2010-06-03 09:24:48 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2010-06-03 09:24:48 (GMT) |
commit | a1528245b280f1068daad8cd850ea345a3f8b568 (patch) | |
tree | 060dc6ccdb347682a1d4b73ab3098d95599532f2 /src/portable.cpp | |
parent | a3b06c4fd310fdeda48a4730139cee09b5302072 (diff) | |
download | Doxygen-a1528245b280f1068daad8cd850ea345a3f8b568.zip Doxygen-a1528245b280f1068daad8cd850ea345a3f8b568.tar.gz Doxygen-a1528245b280f1068daad8cd850ea345a3f8b568.tar.bz2 |
Release-1.6.3-20100603
Diffstat (limited to 'src/portable.cpp')
-rw-r--r-- | src/portable.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/portable.cpp b/src/portable.cpp index 41eff1c..eee8239 100644 --- a/src/portable.cpp +++ b/src/portable.cpp @@ -27,11 +27,10 @@ extern char **environ; //#include "doxygen.h" static double sysElapsedTime; +static QTime time; int portable_system(const char *command,const char *args,bool commandHasConsole) { - QTime time; - time.start(); if (command==0) return 1; @@ -79,7 +78,6 @@ int portable_system(const char *command,const char *args,bool commandHasConsole } } } - sysElapsedTime+=((double)time.elapsed())/1000.0; return status; #else // Other Unices just use fork @@ -104,7 +102,6 @@ int portable_system(const char *command,const char *args,bool commandHasConsole } else { - sysElapsedTime+=((double)time.elapsed())/1000.0; if (WIFEXITED(status)) { return WEXITSTATUS(status); @@ -158,7 +155,6 @@ int portable_system(const char *command,const char *args,bool commandHasConsole CloseHandle(sInfo.hProcess); } } - sysElapsedTime+=((double)time.elapsed())/1000.0; return 0; #endif @@ -369,8 +365,26 @@ int portable_pclose(FILE *stream) return pclose(stream); } +void portable_sysTimerStart() +{ + time.start(); +} + +void portable_sysTimerStop() +{ + sysElapsedTime+=((double)time.elapsed())/1000.0; +} + double portable_getSysElapsedTime() { return sysElapsedTime; } +void portable_sleep(int ms) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + Sleep(ms); +#else + usleep(1000*ms); +#endif +} |