diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-11-12 12:14:14 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-11-12 12:14:14 -0500 |
commit | 6744f6b6bba2af2d3d3712825a28e75b0304d7b8 (patch) | |
tree | 1ebebe59b65f7eb0d5082a5306f80ae98b0a3657 | |
parent | b0f9ecdbb138529fb9428121a62e8a5004767761 (diff) | |
download | tor-6744f6b6bba2af2d3d3712825a28e75b0304d7b8.tar.gz tor-6744f6b6bba2af2d3d3712825a28e75b0304d7b8.zip |
HACKING/design: move 01c-time.md into doxygen.
-rw-r--r-- | src/lib/evloop/time_periodic.dox (renamed from doc/HACKING/design/01c-time.md) | 29 | ||||
-rw-r--r-- | src/mainpage.dox | 2 |
2 files changed, 18 insertions, 13 deletions
diff --git a/doc/HACKING/design/01c-time.md b/src/lib/evloop/time_periodic.dox index 5cd0b354fd..b12ae63bdd 100644 --- a/doc/HACKING/design/01c-time.md +++ b/src/lib/evloop/time_periodic.dox @@ -1,5 +1,6 @@ +/** -## Time in tor ## +@page time_periodic Time and periodic events in Tor ### What time is it? ### @@ -33,28 +34,28 @@ tor_gettimeofday_cached(). Tor has functions to parse and format time in these formats: - * RFC1123 format. ("Fri, 29 Sep 2006 15:54:20 GMT"). For this, - use format_rfc1123_time() and parse_rfc1123_time. + - RFC1123 format. ("Fri, 29 Sep 2006 15:54:20 GMT"). For this, + use format_rfc1123_time() and parse_rfc1123_time. - * ISO8601 format. ("2006-10-29 10:57:20") For this, use - format_local_iso_time and format_iso_time. We also support the - variant format "2006-10-29T10:57:20" with format_iso_time_nospace, and - "2006-10-29T10:57:20.123456" with format_iso_time_nospace_usec. + - ISO8601 format. ("2006-10-29 10:57:20") For this, use + format_local_iso_time() and format_iso_time(). We also support the + variant format "2006-10-29T10:57:20" with format_iso_time_nospace(), and + "2006-10-29T10:57:20.123456" with format_iso_time_nospace_usec(). - * HTTP format collections (preferably "Mon, 25 Jul 2016 04:01:11 - GMT" or possibly "Wed Jun 30 21:49:08 1993" or even "25-Jul-16 - 04:01:11 GMT"). For this, use parse_http_time. Don't generate anything - but the first format. + - HTTP format collections (preferably "Mon, 25 Jul 2016 04:01:11 + GMT" or possibly "Wed Jun 30 21:49:08 1993" or even "25-Jul-16 + 04:01:11 GMT"). For this, use parse_http_time(). Don't generate anything + but the first format. Some of these functions use struct tm. You can use the standard -tor_localtime_r and tor_gmtime_r() to wrap these in a safe way. We +tor_localtime_r() and tor_gmtime_r() to wrap these in a safe way. We also have a tor_timegm() function. ### Scheduling events ### The main way to schedule a not-too-frequent periodic event with respect to the Tor mainloop is via the mechanism in periodic.c. -There's a big table of periodic_events in main.c, each of which gets +There's a big table of periodic_events in mainloop.c, each of which gets invoked on its own schedule. You should not expect more than about one second of accuracy with these timers. @@ -73,3 +74,5 @@ accurate within a handful of milliseconds -- possibly better on some platforms. (The timers.c module uses William Ahern's timeout.c implementation as its backend, which is based on a hierarchical timing wheel algorithm. It's cool stuff; check it out.) + +**/ diff --git a/src/mainpage.dox b/src/mainpage.dox index 4f565cf6ec..1da074951a 100644 --- a/src/mainpage.dox +++ b/src/mainpage.dox @@ -38,6 +38,8 @@ Tor repository. @subpage strings +@subpage time_periodic + **/ /** |