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

Convert TrueTime to use Date.now #66

Merged
merged 3 commits into from
Feb 29, 2024
Merged

Convert TrueTime to use Date.now #66

merged 3 commits into from
Feb 29, 2024

Conversation

osmestad
Copy link
Contributor

This should be a simpler approach that has less risk of clock drift that can happen with performance.now() used over idle time-spans.
Using our trueTime.now() when setting performance marks should ensure all timestamps are of the same type/time-scale.

This should be a simpler approach that has less risk of clock drift that can happen with `performance.now()` used over idle time-spans.
Using our `trueTime.now()` when setting performance marks should ensure all timestamps are of the same type/time-scale.
@osmestad osmestad requested review from enjikaka and a team as code owners February 28, 2024 20:50
Copy link

github-actions bot commented Feb 28, 2024

Coverage Report for Auth (packages/auth)

Status Category Percentage Covered / Total
🟢 Lines 95.11% (🎯 80%) 1265 / 1330
🟢 Statements 95.11% (🎯 80%) 1265 / 1330
🟢 Functions 82.75% (🎯 80%) 48 / 58
🟢 Branches 96.4% (🎯 80%) 161 / 167
File CoverageNo changed files found.
Generated in workflow #238

Copy link

github-actions bot commented Feb 28, 2024

Coverage Report for Common (packages/common)

Status Category Percentage Covered / Total
🟢 Lines 50% (🎯 50%) 70 / 140
🟢 Statements 50% (🎯 50%) 70 / 140
🟢 Functions 37.5% (🎯 37%) 3 / 8
🟢 Branches 42.85% (🎯 42%) 3 / 7
File CoverageNo changed files found.
Generated in workflow #238

Copy link

github-actions bot commented Feb 28, 2024

Coverage Report for Event Producer (packages/event-producer)

Status Category Percentage Covered / Total
🟢 Lines 87.33% (🎯 80%) 807 / 924
🟢 Statements 87.33% (🎯 80%) 807 / 924
🟢 Functions 82.6% (🎯 80%) 38 / 46
🟢 Branches 84.88% (🎯 80%) 73 / 86
File CoverageNo changed files found.
Generated in workflow #238

Copy link

github-actions bot commented Feb 28, 2024

Coverage Report for Player Web Components (packages/player-web-components)

Status Category Percentage Covered / Total
🟢 Lines 8.81% (🎯 8%) 68 / 771
🟢 Statements 8.81% (🎯 8%) 68 / 771
🟢 Functions 30% (🎯 30%) 3 / 10
🟢 Branches 66.66% (🎯 66%) 18 / 27
File CoverageNo changed files found.
Generated in workflow #238

Copy link

github-actions bot commented Feb 28, 2024

Coverage Report for Template (packages/template)

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 80%) 5 / 5
🟢 Statements 100% (🎯 80%) 5 / 5
🟢 Functions 100% (🎯 80%) 1 / 1
🟢 Branches 100% (🎯 80%) 1 / 1
File CoverageNo changed files found.
Generated in workflow #238

Copy link

github-actions bot commented Feb 28, 2024

Coverage Report for True Time (packages/true-time)

Status Category Percentage Covered / Total
🟢 Lines 93.75% (🎯 80%) 90 / 96
🟢 Statements 93.75% (🎯 80%) 90 / 96
🟢 Functions 100% (🎯 80%) 5 / 5
🟢 Branches 85% (🎯 80%) 17 / 20
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/true-time/src/index.ts 93.75% 85% 100% 93.75% 41-42, 44-45, 56-57
Generated in workflow #238

async synchronize() {
if (this.#synced) {
async synchronize(): Promise<void> {
const anHour = 3_600_000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put 1_000_000 in PR since ChatGPT said this about NTP;

As a general guideline, a common default configuration for many systems is to synchronize every 64 to 1,024 seconds (approximately 1 to 17 minutes).

1 million ms is 16.67 minutes so figured that was nice. :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, so that was where you got the number from :-P I figured an hour should be frequent enough..

@osmestad osmestad merged commit 37f8698 into main Feb 29, 2024
4 checks passed
@osmestad osmestad deleted the oyvind/true-time-simpler branch February 29, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants