Skip to content

Commit

Permalink
fix: Duration precision on Windows (#1342)
Browse files Browse the repository at this point in the history
* fix: Duration precision on Windows

* fix: duration display on windows, when duration is unknown/infinity
  • Loading branch information
ArthurHeitmann committed Dec 7, 2022
1 parent 8a13f96 commit 3cda1a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -102,13 +102,13 @@ Future<void> testStreamsTab(
extension StreamWidgetTester on WidgetTester {
// Precision for duration & position:
// Android: two tenth of a second
// Windows: second
// Windows: millisecond
// Linux: second
// Web: second

// Update interval for duration & position:
// Android: two tenth of a second
// Windows: second
// Windows: ~250ms
// Linux: second
// Web: second

Expand Down
Expand Up @@ -148,7 +148,9 @@ constexpr uint64_t c_hnsPerSecond = 10000000;
template<typename SecondsT>
inline uint64_t ConvertSecondsToHns(SecondsT seconds)
{
return static_cast<uint64_t>(seconds) * c_hnsPerSecond;
if (isinf(seconds))
return 0;
return static_cast<uint64_t>(seconds * c_hnsPerSecond);
}

template<typename HnsT>
Expand Down

0 comments on commit 3cda1a6

Please sign in to comment.