diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclClock.c | 9 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 22 | ||||
-rw-r--r-- | generic/tclInt.h | 6 |
3 files changed, 29 insertions, 8 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index 1abd1e1..35bae5b 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.56 2006/08/10 13:07:43 dkf Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.57 2006/08/21 01:08:41 das Exp $ */ #include "tclInt.h" @@ -1689,7 +1689,12 @@ ClockClicksObjCmd( break; case CLICKS_NATIVE: Tcl_SetObjResult(interp, Tcl_NewWideIntObj( (Tcl_WideInt) - TclpGetClicks())); +#ifndef TCL_WIDE_CLICKS + TclpGetClicks() +#else + TclpGetWideClicks() +#endif + )); break; case CLICKS_MICROS: Tcl_GetTime(&now); diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index d955691..a77431c 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.134 2005/12/19 19:03:16 dgp Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.135 2006/08/21 01:08:41 das Exp $ */ #include "tclInt.h" @@ -2921,7 +2921,11 @@ Tcl_TimeObjCmd(dummy, interp, objc, objv) register int i, result; int count; double totalMicroSec; +#ifndef TCL_WIDE_CLICKS Tcl_Time start, stop; +#else + Tcl_WideInt start, stop; +#endif if (objc == 2) { count = 1; @@ -2937,17 +2941,25 @@ Tcl_TimeObjCmd(dummy, interp, objc, objv) objPtr = objv[1]; i = count; +#ifndef TCL_WIDE_CLICKS Tcl_GetTime(&start); +#else + start = TclpGetWideClicks(); +#endif while (i-- > 0) { result = Tcl_EvalObjEx(interp, objPtr, 0); if (result != TCL_OK) { return result; } } +#ifndef TCL_WIDE_CLICKS Tcl_GetTime(&stop); - - totalMicroSec = (((double) (stop.sec - start.sec))*1.0e6 - + (stop.usec - start.usec)); + totalMicroSec = ((double) (stop.sec - start.sec))*1.0e6 + + (stop.usec - start.usec); +#else + stop = TclpGetWideClicks(); + totalMicroSec = ((double) TclpWideClicksToNanoseconds(stop - start))/1.0e3; +#endif if (count <= 1) { /* @@ -2961,7 +2973,7 @@ Tcl_TimeObjCmd(dummy, interp, objc, objv) /* * Construct the result as a list because many programs have always parsed - * at such (extracting the first element, typically). + * as such (extracting the first element, typically). */ objs[1] = Tcl_NewStringObj("microseconds", -1); diff --git a/generic/tclInt.h b/generic/tclInt.h index ecc7615..0f34ea5 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.274 2006/07/21 14:56:14 dgp Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.275 2006/08/21 01:08:41 das Exp $ */ #ifndef _TCLINT @@ -2232,6 +2232,10 @@ MODULE_SCOPE int TclpLoadMemory(Tcl_Interp *interp, void *buffer, MODULE_SCOPE void TclInitThreadStorage(void); MODULE_SCOPE void TclpFinalizeThreadDataThread(void); MODULE_SCOPE void TclFinalizeThreadStorage(void); +#ifdef TCL_WIDE_CLICKS +MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); +MODULE_SCOPE Tcl_WideInt TclpWideClicksToNanoseconds(Tcl_WideInt clicks); +#endif /* *---------------------------------------------------------------- |