Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howto:time [2012/03/14 12:58] – schroeter | user_guide:tutorials:time [2019/02/11 17:16] (current) – ↷ Page moved from user_guide:howto:time to user_guide:tutorials:time oroehrig | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Measure execution time ====== | ====== Measure execution time ====== | ||
- | The benefit of using a standard programming language such as Perl is that one can use standard libraries for basic needs. Here is an example showing how to benchmark two different convex hull algorithms/ | + | The benefit of using a standard programming language such as Perl is that one can use standard libraries for basic needs. For example, one can measure the runtime/ |
< | < | ||
use Benchmark qw(:all); | use Benchmark qw(:all); | ||
Line 7: | Line 7: | ||
$r=rand_sphere(3, | $r=rand_sphere(3, | ||
</ | </ | ||
- | This code does not work in a [[scripting: | + | Note that if timing a user function, you have to provide the application your function lives in: |
+ | < | ||
+ | polytope > $t=timeit(1,' | ||
+ | </ | ||
+ | |||
+ | The above code does not work in a [[scripting: | ||
< | < | ||
use Benchmark qw(:all); | use Benchmark qw(:all); |