Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVR output: we print 6 digits worth of microseconds #2143

Merged
merged 1 commit into from
Aug 1, 2023

Commits on Jul 19, 2023

  1. EVR output: we print 6 digits worth of microseconds

    This avoids a pernicious behavior where EVR timestamps lie about their
    sub-second values. I have this test program:
    
      #include <stdio.h>
      #include <inttypes.h>
      void main(void)
      {
          printf("%02d:%02d:%02d.%03" PRIu32 "\n", 1,2,3, 12);
          printf("%02d:%02d:%02d.%03" PRIu32 "\n", 1,2,3, 123);
          printf("%02d:%02d:%02d.%03" PRIu32 "\n", 1,2,3, 1234);
          printf("%02d:%02d:%02d.%03" PRIu32 "\n", 1,2,3, 12356);
          printf("%02d:%02d:%02d.%03" PRIu32 "\n", 1,2,3, 123456);
      }
    
    It produces this output:
    
      01:02:03.012
      01:02:03.123
      01:02:03.1234
      01:02:03.12356
      01:02:03.123456
    
    so prior to this patch, if we were 1 hour, 2 minutes, 3 seconds, 123
    microseconds past midnight, this was printed as "01:02:03.123" instead of
    "01:02:03.000123". Any reasonable human looking at "01:02:03.123" would see a
    value of "123000" microseconds.
    dkogan committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    e3dc4a0 View commit details
    Browse the repository at this point in the history