Skip to content

Add builtin type for time duration #26

@AdvancedAntiSkid

Description

@AdvancedAntiSkid

Is your feature request related to a problem? Please describe.
Currently representing time durations are kinda confusing. For instance, some hypixel-native things expect ticks, and it is might not be clear for the user when to use what, especially that they can specify absolute tick values via int and translated ticks via duration constants (eg 1m3s).

Describe the solution you'd like
Somehow differentiate ticks and millis/seconds. Possibly force actions to take in time duration instead of int. Remove implicit conversion from duration to int. Make this behaviour clear and precise.

Describe alternatives you've considered
Could introduce an enum for this eg Interval::Ticks(ticks: int) or Interval::Duration(dur: duration)` but that might be too long.

Additional context
Some short syntax would be awesome.

Metadata

Metadata

Labels

breakingSomething that would be a alter existing logic or syntaxcompilerSomething regarding the compilerenhancementNew feature or requestruntimeSomething regarding the runtime modulestandard librarySomething regarding the standard librarysyntaxSyntax support for a feature
No fields configured for Feature.

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions