Skip to content

Commit

Permalink
Extend arm_time and start_time to nanosecond resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioPeJu committed Feb 16, 2024
1 parent 1d3c940 commit d92547c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/capture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ sample_bytes Number of bytes in one sample unless ``format`` is ``ASCII``.
fields Information about each captured field.
================= ==============================================================

All timestamps are in `ISO 8601 UTC format <https://en.wikipedia.org/wiki/ISO_8601>`_, i.e. ``YYYY-MM-DDTHH:mm:ss.sssZ``.
All timestamps are in
`ISO 8601 UTC format <https://en.wikipedia.org/wiki/ISO_8601>`_ with nanosecond
resolution, i.e. ``YYYY-MM-DDTHH:mm:ss.sssssssssZ``.

``start_time`` will be a hardware timestamp if a hardware time source which
produces non-zero timestamps is selected, otherwise, it will be a system
Expand Down
4 changes: 2 additions & 2 deletions server/prepare.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ static void format_timestamp_message(
struct tm tm;
gmtime_r(&tsp->tv_sec, &tm);
snprintf(timestamp_message, max_len,
"%4d-%02d-%02dT%02d:%02d:%02d.%03ldZ",
"%4d-%02d-%02dT%02d:%02d:%02d.%09ldZ",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec, tsp->tv_nsec / 1000000);
tm.tm_hour, tm.tm_min, tm.tm_sec, tsp->tv_nsec);
}


Expand Down

0 comments on commit d92547c

Please sign in to comment.