Skip to content

SuspendingClock on Windows does not suspend #63224

@grynspan

Description

@grynspan

Description
On Windows, the implementation of SuspendingClock is the same as the implementation of ContinuousClock. Both use QueryPerformanceCounter() which tracks time while sleeping—that is, it is continuous, not suspending.

Steps to reproduce
On Windows, create a SuspendingClock instance and get the current instant. Sleep the computer for a long time. Wake it and get the current instant again. Note that the long sleep is accounted for.

Expected behavior
The suspending clock should not account for the time spent sleeping.

Environment

  • Swift compiler version info
  • Xcode version info
  • Deployment target:

Metadata

Metadata

Assignees

Labels

WindowsPlatform: WindowsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresstandard libraryArea: Standard library umbrella

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions