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]: timeDelta.totalMicroseconds #26658

Open
ajpotts opened this issue Feb 5, 2025 · 1 comment
Open

[Feature Request]: timeDelta.totalMicroseconds #26658

ajpotts opened this issue Feb 5, 2025 · 1 comment

Comments

@ajpotts
Copy link

ajpotts commented Feb 5, 2025

Summary of Feature

Description:
Please add a timeDelta.totalMicroseconds procedure. One application would be for the generation of random seeds.

Is this issue currently blocking your progress?
No, because in arkouda we implemented our own timeDelta.totalMicroseconds procedure. However, it would be more efficient to call it from chapel.

Code Sample

            use Time;

            proc timeDelta.totalMicroseconds(): int{
                return ((days*(24*60*60) + seconds)*1_000_000 + microseconds): int;
            }

            var next: rng.eltType;
            if hasSeed {
                next = rng.next();
            }else{
                const seed =  timeSinceEpoch().totalMicroseconds();
                var randStream0 = new randomStream(rng.eltType, seed);
                next = randStream0.next();
            }
@bradcray
Copy link
Member

bradcray commented Feb 5, 2025

Thanks for filing this, @ajpotts ! Would you be interested in filling a PR contributing this routine to the Time module?

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

3 participants