From 3a952fac481cf7aa3b156d9c670e83f1ddf87126 Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Sun, 10 Oct 2004 12:09:50 +0000 Subject: [PATCH] added sleep function --- Cantera/src/global.h | 1 + Cantera/src/misc.cpp | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Cantera/src/global.h b/Cantera/src/global.h index 3cbca5889..6995edb88 100755 --- a/Cantera/src/global.h +++ b/Cantera/src/global.h @@ -64,6 +64,7 @@ namespace Cantera { /// The directory where temporary files may be created string tmpDir(); + string sleep(); /** * Write a diagnostic message to standard output. diff --git a/Cantera/src/misc.cpp b/Cantera/src/misc.cpp index 5ee9380f7..aafd986c7 100755 --- a/Cantera/src/misc.cpp +++ b/Cantera/src/misc.cpp @@ -43,17 +43,21 @@ namespace Cantera { class Application { public: Application() : linelen(0), stop_on_error(false), -#ifdef WIN32 - tmp_dir(".") -#else - tmp_dir("/tmp") -#endif + //#ifdef WIN32 + tmp_dir("."), sleep("1") + //#else + //tmp_dir(".") + //#endif { char* tmpdir = getenv("TMP"); if (tmpdir == 0) tmpdir = getenv("TEMP"); if (tmpdir != 0) tmp_dir = string(tmpdir); + char* sleepstr = getenv("SLEEP"); + if (sleepstr != 0) { + sleep = string(sleepstr); + } } virtual ~Application() { @@ -74,6 +78,7 @@ namespace Cantera { map options; string tmp_dir; map xmlfiles; + string sleep; }; @@ -216,6 +221,7 @@ namespace Cantera { void setTmpDir(string tmp) { app()->tmp_dir = tmp; } string tmpDir() { appinit(); return app()->tmp_dir; } + string sleep() { appinit(); return app()->sleep; } int nErrors() { return static_cast(app()->errorMessage.size());