time-util.c revision 8bca5ef713f2916dbd60bb2b76e7cc06f4800d4d
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen/* Copyright (c) 2008-2016 Dovecot authors, see the included COPYING file */
7ef3553585e556f35d5919589cfdc1de3329e4bbTimo Sirainenint timeval_cmp(const struct timeval *tv1, const struct timeval *tv2)
e28b88ee83b47dc2257140600f491482704c7b79Stephan Boschint timeval_cmp_margin(const struct timeval *tv1, const struct timeval *tv2,
8bca5ef713f2916dbd60bb2b76e7cc06f4800d4dStephan Bosch if ((tv2->tv_usec - tv1->tv_usec) > (int)usec_margin)
8bca5ef713f2916dbd60bb2b76e7cc06f4800d4dStephan Bosch if ((tv1->tv_usec - tv2->tv_usec) > (int)usec_margin)
7ef3553585e556f35d5919589cfdc1de3329e4bbTimo Sirainenint timeval_diff_msecs(const struct timeval *tv1, const struct timeval *tv2)
7ef3553585e556f35d5919589cfdc1de3329e4bbTimo Sirainenlong long timeval_diff_usecs(const struct timeval *tv1,
c3c07d6527ad28c8546cbbf84c257d178e23c184Timo Sirainenconst char *t_strflocaltime(const char *fmt, time_t t)
c3c07d6527ad28c8546cbbf84c257d178e23c184Timo Sirainen while ((ret = strftime(buf, bufsize, fmt, tm)) == 0) {