Skip to content

Conversation

@alephpiece
Copy link

Description

The original code uses integer division in the time calculation: (end_tv.tv_usec) / 1000. Since an empty kernel launch overhead is typically very small (often less than 1ms), this integer division truncates the microsecond component to 0, leading to significant precision loss and incorrect results.

image

Major Revision

  • Changed the divisor from 1000 to 1000. (floating-point literal). This forces floating-point arithmetic, preserving the microsecond precision required for accurate overhead measurement.

@alephpiece alephpiece requested a review from a team as a code owner January 16, 2026 02:21
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.

1 participant