Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Should totalSeconds and totalMicroseconds support an optional type argument to vary their return type? #26822

Open
lydia-duncan opened this issue Mar 3, 2025 · 0 comments

Comments

@lydia-duncan
Copy link
Member

Summary of Feature

Description:
When discussing #26798 in the team meeting today, there was some uncertainty about the return type used for totalMicroseconds. The user requesting the feature proposed it using int and the main reason totalSeconds uses real seems to be because it must divide the number of microseconds to determine the total number of seconds used. Additionally, there were tests that had used totalSeconds similarly to how totalMicroseconds would be used and some of them explicitly cast the result to an int.

Note that since the type argument would have a default value of the type returned by the methods today, this would not be considered a breaking change on timeDelta.totalSeconds (which is otherwise considered stable) unless we decided to use a different default type for the argument.

Is this issue currently blocking your progress?
no, it was just something that occurred to us

Code Sample

use Time;

var a = new timeDelta(microseconds=10);
writeln(a.totalMicroseconds(t=real));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant