>Well, quite often you need to call time function in a loop. For
>example, you have a loop that accepts network packets, or connections
>and every so often you need to have current system time. The resolution
>of the timer can be specific to application, i.e. it could be seconds,
>milliseconds, or microseconds.a
>
>uint64_t current_time;
>while(1)
>{
>       get_network_data();
>       current_time = update_current_time();
>       ...
>       use_current_time();
>}
>
>So in a tight loop, if update_current_time() calls clock_gettime() on
>every loop iteration, what would kill performance.


Depends whether you call time() (slow) or gettimeofday() (fast)



Casper

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to