summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-02-09 13:45:14 (GMT)
committersebres <sebres@users.sourceforge.net>2017-02-09 13:45:14 (GMT)
commitc88fb138612db4499a9e841453cd14bfd5db7224 (patch)
treeb5047ac8c5dbb28b0abc02d0c9d32893bae6ef97 /generic
parentfb811680f60f0555a27685601c519ff931956593 (diff)
downloadtcl-c88fb138612db4499a9e841453cd14bfd5db7224.zip
tcl-c88fb138612db4499a9e841453cd14bfd5db7224.tar.gz
tcl-c88fb138612db4499a9e841453cd14bfd5db7224.tar.bz2
[win] accomplished winTime module using very fast wide clicks, with denominator scale to/from microseconds, and therefore more precise "timerate" results under windows (using similar mechanisms as by Mac OSX).
Especially multi-threaded, because it works without lock opposite to microseconds (that use crictical section, because of the calibration thread). The reason for usage of wide clicks instead microseconds explains following example (shows 20% performance deference): % timerate -calibrate {} % timerate {clock microseconds} 5000 0.297037 µs/# 14465901 # 3366585 #/sec 4296.906 nett-ms % timerate {clock clicks} 5000 0.247797 µs/# 16869084 # 4035554 #/sec 4180.116 nett-ms
Diffstat (limited to 'generic')
-rw-r--r--generic/tclInt.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index fb0bcb7..3c21de0 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3186,6 +3186,7 @@ MODULE_SCOPE int TclpLoadMemory(Tcl_Interp *interp, void *buffer,
MODULE_SCOPE void TclInitThreadStorage(void);
MODULE_SCOPE void TclFinalizeThreadDataThread(void);
MODULE_SCOPE void TclFinalizeThreadStorage(void);
+
#ifdef TCL_WIDE_CLICKS
MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void);
MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks);
@@ -3194,17 +3195,12 @@ MODULE_SCOPE double TclpWideClickInMicrosec(void);
# ifdef _WIN32
# define TCL_WIDE_CLICKS 1
MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void);
+MODULE_SCOPE double TclpWideClickInMicrosec(void);
# define TclpWideClicksToNanoseconds(clicks) \
- ((double)(clicks) * 1000)
-# define TclpWideClickInMicrosec() (1)
+ ((double)(clicks) * TclpWideClickInMicrosec() * 1000)
# endif
#endif
-#ifndef _WIN32
MODULE_SCOPE Tcl_WideInt TclpGetMicroseconds(void);
-#else
-# define TclpGetMicroseconds() \
- TclpGetWideClicks()
-#endif
MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp);
MODULE_SCOPE void * TclpThreadCreateKey(void);