X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftimer%2F_info;h=d76a7e670cf1d21e19d93ac9d4f0cbabef03e4f1;hb=HEAD;hp=4c58d9e5f5bee7da8dce493b53946f84931b8975;hpb=291237b4fed863be74051274ac5ad9920cb33cc3;p=ccan diff --git a/ccan/timer/_info b/ccan/timer/_info index 4c58d9e5..d76a7e67 100644 --- a/ccan/timer/_info +++ b/ccan/timer/_info @@ -28,29 +28,28 @@ * { * struct timers timers; * struct list_head strings; - * struct list_head expired; + * struct timer *t; * struct timed_string *s; * - * timers_init(&timers, time_now()); + * (void)argc; + * timers_init(&timers, time_mono()); * list_head_init(&strings); * * while (argv[1]) { * s = malloc(sizeof(*s)); * s->string = argv[1]; - * timer_add(&timers, &s->timer, - * timeabs_add(time_now(), - * time_from_msec(atol(argv[2])))); + * timer_addrel(&timers, &s->timer, + * time_from_msec(atol(argv[2]))); * list_add_tail(&strings, &s->node); * argv += 2; * } * * while (!list_empty(&strings)) { - * struct timeabs now = time_now(); + * struct timemono now = time_mono(); * list_for_each(&strings, s, node) * printf("%s", s->string); - * timers_expire(&timers, now, &expired); - * while ((s = list_pop(&expired, struct timed_string, - * timer.list)) != NULL) { + * while ((t = timers_expire(&timers, now)) != NULL) { + * s = container_of(t, struct timed_string, timer); * list_del_from(&strings, &s->node); * free(s); * } @@ -71,7 +70,6 @@ int main(int argc, char *argv[]) if (strcmp(argv[1], "depends") == 0) { printf("ccan/array_size\n"); printf("ccan/ilog\n"); - printf("ccan/likely\n"); printf("ccan/list\n"); printf("ccan/time\n"); return 0;