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

Send real frame time in Darwin clocks #263

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

JakeWharton
Copy link
Collaborator

And test that it does.

Refs #237

@JakeWharton
Copy link
Collaborator Author

Note that this test is disabled on iOS and tvOS as we have to run the test through XCTest and show a dummy application in order to get frame pulses.

val frameTimeB = DisplayLinkClock.withFrameNanos { it }
assertThat(frameTimeA).all {
isPositive()
isLessThan(frameTimeB)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it testing that frameTimeA ran before frameTimeB? and we assume that the code is executed fast enough for it to make sense?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Because it's nanos it's basically impossible to get two of the same values back since the precision is so high.

@JakeWharton JakeWharton merged commit 5dd1d1b into trunk Jul 7, 2023
@JakeWharton JakeWharton deleted the jw.darwin-time-test.2023-07-07 branch July 7, 2023 11:56
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