>>> Chris Leech <cle...@redhat.com> schrieb am 12.06.2013 um 07:24 in Nachricht
<1371014686-22334-8-git-send-email-cle...@redhat.com>:
[...]
> diff --git a/usr/event_poll.c b/usr/event_poll.c
> index f36fec1..dcbb79a 100644
> --- a/usr/event_poll.c
> +++ b/usr/event_poll.c
> @@ -121,17 +121,37 @@ static int shutdown_wait_pids(void)
>  static int event_loop_stop;
>  static queue_task_t *shutdown_qtask; 
>  
> -
>  void event_loop_exit(queue_task_t *qtask)
>  {
>       shutdown_qtask = qtask;
>       event_loop_stop = 1;
>  }
>  
> +#include <time.h>
> +
> +uint64_t elapsed_ticks(struct timespec *start, struct timespec *end)
> +{
> +     struct timespec elapsed;
> +
> +     if ((end->tv_nsec - start->tv_nsec) < 0) {
> +             elapsed.tv_sec = end->tv_sec - start->tv_sec - 1;
> +             elapsed.tv_nsec = 1000000000 + end->tv_nsec - start->tv_nsec;

What about using a symbolic constant?:
/usr/src/linux/include/linux/time.h:#define NSEC_PER_SEC        1000000000L

> +     } else{
> +             elapsed.tv_sec = end->tv_sec - start->tv_sec;
> +             elapsed.tv_nsec = end->tv_nsec - start->tv_nsec;
> +     }
> +     return (elapsed.tv_sec * (1000 / ACTOR_RESOLUTION)) +
> +            (elapsed.tv_nsec / (1000000 * ACTOR_RESOLUTION));
> +}
> +
[...]

Regards,
Ulrich


-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to