TIP 752: New timer API without Tcl_Time

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Author:		Jan Nijtmans <jan.nijtmans@gmail.com>
State:		Draft
Type:		Project
Vote:		Pending
Created:	22-4-2026
Tcl-Version:	9.1
Tk-Branch:      new-timer-api
Vote-Summary:	
Votes-For:	
Votes-Against:	
Votes-Present:	

Abstract

This TIP proposes to add a new API, in which the Tcl_Time * argument is replaced with long long. A Tcl_Time * value of NULL can be replaced by simply the value -1.

Rationale

Using those, you no longer need to split the time value in seconds and microseconds part and dealing with overflows between those fields.

Implementation

The following new functions are available:

  • void Tcl_ConditionWait2(Tcl_Condition *condPtr, Tcl_Mutex *mutexPtr, long long time)

  • long long Tcl_GetDayTime(void)

  • void Tcl_LimitSetTime2(Tcl_Interp *interp, long long timeLimit)

  • long long Tcl_LimitGetTime2(Tcl_Interp *interp)

  • void Tcl_SetMaxBlockTime2(long long time)

  • void Tcl_SetTimer2(long long time)

  • int Tcl_WaitForEvent2(long long time)

Implementation is in Tcl branch "new-timer-api".

Copyright

This document has been placed in the public domain.

History