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

[core] Increased FormatTime precision #1766

Merged

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Jan 27, 2021

The internal clock might have a nanosecond precision or any other below 1 microsecond.
The FormatTime function used for logging prints only a microsecond precision, which might be not enough for some scenarios.

This PR improves the precision of the FormatTime function to the actual precision of the clock used.

Example output: 05:53:45.21225876683803 [STDY].

Other changes

  • Internal constant s_cpu_frequency (sync_posix.cpp) renamed to s_clock_ticks_per_us.

TODO

  • Find a better name for clock_subsecond_precision() function. Found: clockSubsecondPrecision().
  • Fix sync FormatTime unit test

@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Jan 27, 2021
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Jan 27, 2021
@maxsharabayko maxsharabayko self-assigned this Jan 27, 2021
@maxsharabayko maxsharabayko marked this pull request as ready for review January 28, 2021 11:57
@maxsharabayko maxsharabayko merged commit 74fc74a into Haivision:master Jan 29, 2021
@maxsharabayko maxsharabayko deleted the hotfix/formattime-precision branch January 29, 2021 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants