Rules / Types, classes & roles / basic

Telemetry::Period Reference

Performance data over a period

What it is #

Examples, run three ways #

Every example below comes from the official documentation, together with the output that documentation asserts. Each was then executed by Rakudo and by Raku++ when this page was built. Where the three agree, one result is shown; where they do not, all three are — because which of them is wrong is exactly the information worth having.

2 no-output

=begin code :preamble<class Telemetry { }>
class Telemetry::Period is Telemetry { }
=end code

Not executed: the documentation states no expected output for this example.

# basic usage
use Telemetry;
my $t0 = Telemetry.new;
# execute some code
my $t1 = Telemetry.new;
my $period = $t1 - $t0;  # creates Telemetry::Period object
say "Code took $period<wallclock> microseconds to execute";

Not executed: the documentation states no expected output for this example.