Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TimeCore
Summary
This PR proposes the creation of a TimeCore abstract class to serve as the foundational core for managing time-related functionalities. This class can be extended to create specific components such as timers, stopwatches, alarm clocks, and clocks. The TimeCore class leverages the Temporal API for precise time management and supports updating the current time at regular intervals.
Motivation
The motivation behind this RFC is to provide a flexible and efficient core for time-related components, enabling consistent and simplified management of time functionalities. By creating an abstract TimeCore class, we ensure a robust foundation that can be extended to various use cases, such as timers, stopwatches, and clocks, while maintaining consistent behavior and time management practices.
Parameters
timeZone?: Temporal.TimeZoneLike
An optional parameter that specifies the time zone to use for the current time. Defaults to the system's time zone.
###Methods
getCurrentTime(): Temporal.ZonedDateTime
Returns the current time.
setTimeZone(timeZone: Temporal.TimeZoneLike): void
Sets a new time zone and updates the current time accordingly.
startUpdatingTime(intervalMs?: number): void
Starts updating the current time at the specified interval in milliseconds.
stopUpdatingTime(): void
Stops updating the current time.