diff options
author | Matt Turner <mattst88@gmail.com> | 2008-11-13 22:44:26 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2008-11-13 22:44:26 +0000 |
commit | b59b0af0b26bcca27af0216309c15da663bcd9b7 (patch) | |
tree | 154c5adfa9465c89d1c07ee9b687fb0d01907763 | |
parent | 10e698ace1542d5351935fcb5216af5514a4f7b0 (diff) |
-- Begin stripping useless timing function wrappers and defines
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@19 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
-rw-r--r-- | nmglobal.h | 51 | ||||
-rw-r--r-- | sysspec.c | 66 |
2 files changed, 0 insertions, 117 deletions
@@ -49,57 +49,6 @@ #define MALLOCMEM /* -** Define DOS16MEM if you're running in the old 16-bit segmented -** model. This enables some fruity memory management routines -** required for that model. NOT defining this assumes that -** you're running in an environment that allows malloc() to -** get > 64K chunks of memory. -*/ -/* #define DOS16MEM */ - -/* Define MACMEM to use the Mac's GetPtr call to allocate -** memory (instead of malloc()). -*/ -/* #define MACMEM */ - -/* +++ TIMING +++ */ -/* -** You must define ONLY ONE of the following identifiers to pick -** the timing routine used. -** CLOCKWCPS -** CLOCKWCT -** MACTIMEMGR -** WIN31TIMER -*/ - -/* -** Define CLOCKWCPS if you are using the clock() routine and the -** constant used as the divisor to determine seconds is -** CLOCKS_PER_SEC. This is the default in most cases. -*/ -#define CLOCKWCPS - -/* -** Define CLOCKWCT if you are using the clock() routine and the -** constant used as the divisor to determine seconds is CLK_TCK -*/ -/* #define CLOCKWCT */ - -/* -** Define MACTIMEMGR to use the Mac Time manager routines. -** You'll need to be running at least system 6.0.3 or -** better...extended time manager is recommended (system 7 or -** better). -*/ -/* #define MACTIMEMGR */ - -/* -** Define WIN31TIMER to user the timing routines in TOOLHELP.DLL. -** Gets accuracy down to the millisecond. -*/ -/* #define WIN31TIMER */ - -/* ** ERROR CODES */ #define ERROR_MEMORY 1 @@ -418,25 +418,7 @@ return; */ unsigned long StartStopwatch() { -#ifdef MACTIMEMGR -/* -** For Mac code warrior, use timer. In this case, what we return is really -** a dummy value. -*/ -InsTime((QElemPtr)&myTMTask); -PrimeTime((QElemPtr)&myTMTask,-MacHSTdelay); -return((unsigned long)1); -#else -#ifdef WIN31TIMER -/* -** Win 3.x timer returns a DWORD, which we coax into a long. -*/ -_Call16(lpfn,"p",&win31tinfo); -return((unsigned long)win31tinfo.dwmsSinceStart); -#else return((unsigned long)clock()); -#endif -#endif } /**************************** @@ -447,20 +429,7 @@ return((unsigned long)clock()); unsigned long StopStopwatch(unsigned long startticks) { -#ifdef MACTIMEMGR -/* -** For Mac code warrior...ignore startticks. Return val. in microseconds -*/ -RmvTime((QElemPtr)&myTMTask); -return((unsigned long)(MacHSTdelay+myTMTask.tmCount-MacHSTohead)); -#else -#ifdef WIN31TIMER -_Call16(lpfn,"p",&win31tinfo); -return((unsigned long)win31tinfo.dwmsSinceStart-startticks); -#else return((unsigned long)clock()-startticks); -#endif -#endif } /**************************** @@ -470,25 +439,7 @@ return((unsigned long)clock()-startticks); */ unsigned long TicksToSecs(unsigned long tickamount) { -#ifdef CLOCKWCT -return((unsigned long)(tickamount/CLK_TCK)); -#endif - -#ifdef MACTIMEMGR -/* +++ MAC time manager version (using timer in microseconds) +++ */ -return((unsigned long)(tickamount/1000000)); -#endif - -#ifdef CLOCKWCPS -/* Everybody else */ return((unsigned long)(tickamount/CLOCKS_PER_SEC)); -#endif - -#ifdef WIN31TIMER -/* Each tick is 840 nanoseconds */ -return((unsigned long)(tickamount/1000L)); -#endif - } /**************************** @@ -499,23 +450,6 @@ return((unsigned long)(tickamount/1000L)); */ double TicksToFracSecs(unsigned long tickamount) { -#ifdef CLOCKWCT -return((double)tickamount/(double)CLK_TCK); -#endif - -#ifdef MACTIMEMGR -/* +++ MAC time manager version +++ */ -return((double)tickamount/(double)1000000); -#endif - -#ifdef CLOCKWCPS -/* Everybody else */ return((double)tickamount/(double)CLOCKS_PER_SEC); -#endif - -#ifdef WIN31TIMER -/* Using 840 nanosecond ticks */ -return((double)tickamount/(double)1000); -#endif } |