X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftime%2Ftime.h;fp=ccan%2Ftime%2Ftime.h;h=54d92c57b89090152a9c1a42e10c656ee0c2e82c;hp=5c916f4c4c2ef04b9648791d862bb3eea731a6cd;hb=c0b655441804c0edace4f539fb9008b315eb1bd8;hpb=becfc7c324d821fe135a1ad843c596399ed5068a;ds=sidebyside diff --git a/ccan/time/time.h b/ccan/time/time.h index 5c916f4c..54d92c57 100644 --- a/ccan/time/time.h +++ b/ccan/time/time.h @@ -127,7 +127,7 @@ struct timeabs time_now(void); * This value is only really useful for measuring time intervals. * * See also: - * time_since() + * timemono_since() */ struct timemono time_mono(void); @@ -320,6 +320,17 @@ static inline struct timerel timemono_between(struct timemono recent, return t; } +/** + * timemono_since - elapsed monotonic time since @old + * @old: a monotonic time from the past. + */ +static inline struct timerel timemono_since(struct timemono old) +{ + struct timemono now = time_mono(); + + return timemono_between(now, old); +} + /** * timeabs_sub - subtract a relative time from an absolute time * @abs: the absolute time.