From 9d46c94a8e168f006daab3bc342ff213b1b23fc3 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik <andy.cedilnik@kitware.com> Date: Tue, 4 Jan 2005 10:55:01 -0500 Subject: [PATCH] ENH: Add a delay method --- SystemTools.cxx | 9 +++++++++ SystemTools.hxx.in | 3 +++ 2 files changed, 12 insertions(+) diff --git a/SystemTools.cxx b/SystemTools.cxx index b0e61e2..3453cc8 100644 --- a/SystemTools.cxx +++ b/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/SystemTools.hxx.in b/SystemTools.hxx.in index d78c492..7eaccb3 100644 --- a/SystemTools.hxx.in +++ b/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 /** -- GitLab