Jim Tcl
Check-in [6dad0537c9]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:eventloop: remove leftover debugging

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6dad0537c956e0c0d7831723d65354836d5b43ad
User & Date: steveb@workware.net.au 2017-10-15 21:03:09
Context
2017-10-15
23:00
after: Need to initialise 'ms'

Also fix a warning on Windows

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 459cf36faa user: steveb@workware.net.au tags: trunk

21:03
eventloop: remove leftover debugging

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 6dad0537c9 user: steveb@workware.net.au tags: trunk

21:00
eventloop: support sub-millisecond timer resolution

Timeouts may now be specified in fractions of milliseconds. e.g. after 0.5

This can be useful on faster systems where 1ms resolution is too coarse.

Also, use clock_gettime(CLOCK_MONOTONIC_RAW) for timers, if available. This clock is insensitive to system clock changes and ntp adjustments.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 43fab94694 user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim-eventloop.c.

215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
jim_wide Jim_CreateTimeHandler(Jim_Interp *interp, jim_wide us,
    Jim_TimeProc * proc, void *clientData, Jim_EventFinalizerProc * finalizerProc)
{
    Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop");
    jim_wide id = ++eventLoop->timeEventNextId;
    Jim_TimeEvent *te, *e, *prev;

    printf("Create time handler, us=%lld, now=%lld\n", us, JimGetTimeUsec(eventLoop));

    te = Jim_Alloc(sizeof(*te));
    te->id = id;
    te->initialus = us;
    te->when = JimGetTimeUsec(eventLoop) + us;
    te->timeProc = proc;
    te->finalizerProc = finalizerProc;
    te->clientData = clientData;







<
<







215
216
217
218
219
220
221


222
223
224
225
226
227
228
jim_wide Jim_CreateTimeHandler(Jim_Interp *interp, jim_wide us,
    Jim_TimeProc * proc, void *clientData, Jim_EventFinalizerProc * finalizerProc)
{
    Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop");
    jim_wide id = ++eventLoop->timeEventNextId;
    Jim_TimeEvent *te, *e, *prev;



    te = Jim_Alloc(sizeof(*te));
    te->id = id;
    te->initialus = us;
    te->when = JimGetTimeUsec(eventLoop) + us;
    te->timeProc = proc;
    te->finalizerProc = finalizerProc;
    te->clientData = clientData;