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

Can the first argument be CPU-based like in perl5 please? #6

Open
Tux opened this issue Jun 1, 2015 · 4 comments
Open

Can the first argument be CPU-based like in perl5 please? #6

Tux opened this issue Jun 1, 2015 · 4 comments

Comments

@Tux
Copy link

Tux commented Jun 1, 2015

As I test on many different systems ranging from 240 MHz to 4.2 GHz, using a count isn't quite useful, so I generally op for the negative value in perl5 which makes it CPU seconds

my %results = timethese(-1.5, { ... });

Type check failed in binding $count; expected 'Int' but got 'Rat'
in sub timethese at lib/Benchmark.pm6:21

@perlpilot
Copy link
Owner

Sure .... however, the Perl 5 version of Benchmark relies on the "times" function to calculate CPU seconds which currently does not have an analog in Rakudo that I know about. I'll see what I can do about it.

@azawawi
Copy link

azawawi commented Nov 4, 2017

Seems like we have it now https://irclog.perlgeek.de/perl6/2017-11-04#i_15401962 👍

@lizmat
Copy link

lizmat commented Nov 4, 2017

Actually, Telemetry is so much more than that. If we want to support the basic P5 functionality, then we should have enough with nqp::getrusage. We probably want to expose that more easily than Telemetry does.

@lizmat
Copy link

lizmat commented Nov 4, 2017

I've now exposed basic CPU usage information with Kernel.cpu-usage (in microseconds)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants