user_guide:tutorials:time

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
user_guide:tutorials:time [2014/01/03 15:45]
127.0.0.1 external edit
user_guide:tutorials:time [2019/02/11 17:16] (current)
oroehrig ↷ Page moved from user_guide:howto:time to user_guide:tutorials:time
Line 7: Line 7:
 $r=rand_sphere(3,​1000,​seed=>​1);​ $t=timeit(1,'​prefer_now("​beneath_beyond"​);​$r->​FACETS;'​);​ print timestr($t);​ $r=rand_sphere(3,​1000,​seed=>​1);​ $t=timeit(1,'​prefer_now("​beneath_beyond"​);​$r->​FACETS;'​);​ print timestr($t);​
 </​code>​ </​code>​
-This code does not work in a [[scripting:​start|script]] file (.pl) because of polymake'​s modifications to Perl. You rather want to use something like this.+Note that if timing a user function, you have to provide the application your function lives in: 
 +<​code>​ 
 +polytope > $t=timeit(1,'​Polymake::​polytope::​rand_box(10,​2000,​1);'​);​ 
 +</​code>​ 
 + 
 +The above code does not work in a [[scripting:​start|script]] file (.pl) because of polymake'​s modifications to Perl. You rather want to use something like this.
 <​code>​ <​code>​
 use Benchmark qw(:all); use Benchmark qw(:all);
  • user_guide/tutorials/time.1388763918.txt.gz
  • Last modified: 2017/02/03 17:06
  • (external edit)