From 320e90ef5aabc50f6bfb3d32b8cb95702a446d98 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 4 Jan 2005 10:55:01 -0500 Subject: [PATCH] ENH: Add a delay method --- Source/kwsys/SystemTools.cxx | 9 +++++++++ Source/kwsys/SystemTools.hxx.in | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index b81609966..b3b1e7a26 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2100,6 +2100,15 @@ kwsys_stl::string SystemTools::FileExistsInParentDirectories(const char* fname, return ""; } +void SystemTools::Delay(unsigned int msec) +{ +#ifdef _WIN32 + Sleep(msec); +#else + usleep(msec * 1000); +#endif +} + // These must NOT be initialized. Default initialization to zero is // necessary. unsigned int SystemToolsManagerCount; diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 1d148cacd..e2fee4550 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -338,6 +338,9 @@ public: static kwsys_stl::string FileExistsInParentDirectories(const char* fname, const char* directory, const char* toplevel); + /** Delay the execution for a specified amount of time specified in miliseconds */ + static void Delay(unsigned int msec); + protected: // these two functions can be called from ConvertToOutputPath /**