Tony Mountifield wrote: > In article <[EMAIL PROTECTED]>, > Ryan Burke <[EMAIL PROTECTED]> wrote: > >> I just was looking over the app_waitutil.c and am confused you add 500 to >> tv.tv_usec on the line "msec = (future - tv.tv_sec) * 1000 - ((tv.tv_usec >> + 500) / 1000);"? >> > > It's just doing a standard "round to nearest" integer division, by adding > half the divisor to the dividend before dividing. Without that, you just > get "round down" instead. > > Cheers > Tony >
That's right. ast_safe_sleep() has a resolution of msec, but gettimeofday() returns the time in usec, so conversion to the nearest whole msec is necessary. -Philip _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
