From: Vladimír Čunát Date: Mon, 11 Dec 2017 12:25:18 +0000 (+0100) Subject: monotonic timestamps: document they are milliseconds X-Git-Tag: v1.5.1~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f8b6c5ba7bc4a81af8edda8f9f55e11280ca00f;p=thirdparty%2Fknot-resolver.git monotonic timestamps: document they are milliseconds --- diff --git a/lib/cache.h b/lib/cache.h index b6fd92ea0..66c6cdb01 100644 --- a/lib/cache.h +++ b/lib/cache.h @@ -78,7 +78,7 @@ struct kr_cache uint32_t ttl_min, ttl_max; /**< Maximum TTL of inserted entries */ struct timeval last_clear_walltime; /**< Time of last cache clear */ - uint64_t last_clear_monotime; /**< Last cache clear in monotonic time */ + uint64_t last_clear_monotime; /**< Last cache clear in monotonic milliseconds */ }; /** diff --git a/lib/rplan.h b/lib/rplan.h index 6b7487c5b..44118ea4c 100644 --- a/lib/rplan.h +++ b/lib/rplan.h @@ -84,11 +84,11 @@ struct kr_query { uint32_t secret; uint16_t fails; uint16_t reorder; /**< Seed to reorder (cached) RRs in answer or zero. */ - uint64_t creation_time_mono; /* The time of query's creation. + uint64_t creation_time_mono; /* The time of query's creation (milliseconds). * Or time of creation of an oldest * ancestor if it is a subquery. */ - uint64_t timestamp_mono; /**< Time of query created or time of - query to upstream resolver */ + uint64_t timestamp_mono; /**< Time of query created or time of + * query to upstream resolver (milliseconds). */ struct timeval timestamp; struct kr_zonecut zone_cut; struct kr_nsrep ns; diff --git a/lib/utils.h b/lib/utils.h index d68809892..de727771a 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -300,6 +300,10 @@ static inline const char *lua_push_printf(lua_State *L, const char *fmt, ...) return ret; } +/** The current time in monotonic milliseconds. + * + * \note it may be outdated in case of long callbacks; see uv_now(). + */ KR_EXPORT uint64_t kr_now();