[asterisk-users] New feature: calling all bug marshals

Ryan Burke burke at tailorhosting.com
Wed Dec 5 09:35:11 CST 2007


> In article
> <15243.199.46.199.237.1196858285.squirrel at www.tailorhosting.com>,
> Ryan Burke <burke at tailorhosting.com> 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
> --
> Tony Mountifield
> Work: tony at softins.co.uk - http://www.softins.co.uk
> Play: tony at mountifield.org - http://tony.mountifield.org


I see, sorry it was a brain fart...

Thanks!



More information about the asterisk-users mailing list