diff options
author | sebres <sebres@users.sourceforge.net> | 2017-02-09 11:36:17 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-02-09 11:36:17 (GMT) |
commit | fb811680f60f0555a27685601c519ff931956593 (patch) | |
tree | 1fd7d26262a58c457148ba5448a9339c3d92771a /generic/tclInt.h | |
parent | 1ff982ffd6785745b647bbe0bb46aca7e13ace8e (diff) | |
download | tcl-fb811680f60f0555a27685601c519ff931956593.zip tcl-fb811680f60f0555a27685601c519ff931956593.tar.gz tcl-fb811680f60f0555a27685601c519ff931956593.tar.bz2 |
[timerate] bug fix: missing scale conversion by Mac OSX on platform where high resolution clicks are not microseconds based;
[win] use high resolution timer for the wide clicks and microseconds directly, prevent several forwards/backwards conversions;
[win, unix, mac-osx] normalize some functions for common usage in different time units (clicks, micro- and nanoseconds)
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 1b37d84..fb0bcb7 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3189,7 +3189,23 @@ MODULE_SCOPE void TclFinalizeThreadStorage(void); #ifdef TCL_WIDE_CLICKS MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); +MODULE_SCOPE double TclpWideClickInMicrosec(void); +#else +# ifdef _WIN32 +# define TCL_WIDE_CLICKS 1 +MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); +# define TclpWideClicksToNanoseconds(clicks) \ + ((double)(clicks) * 1000) +# define TclpWideClickInMicrosec() (1) +# 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); MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr); |