Reference - Parms functions - hrtime


App: regression/framework - Page: sequence/a_walk_to_the_ceiling_in_stretches_has_the_time_one_run_has
PHP
sequence/a_walk_to_the_ceiling_in_stretches_has_the_time_one_run_has.php
HTML
sequence/a_walk_to_the_ceiling_in_stretches_has_the_time_one_run_has.pad
Result
<?php

// A short reach, so the walk to the ceiling begins at once, and a quarter of a second for
// a run: the walk for 50001, which the expression never makes (an odd position is made
// negative), is held to it for all its stretches together.

$padSeqDefaultTries = 100;
$padSeqMaxSeconds = 0.25;

?>
{set $t = php:hrtime(TRUE)}[{sequence '50001;3', keep, eval='@ % 2 eq 0 ? @ : 0 - @'}{$sequence} {/sequence}]{if (php:hrtime(TRUE) - $t) lt 450000000}held to the time a run has{else}past it{/if}


App: regression/framework - Page: tags/chart_heatmap_takes_time_by_its_cells
PHP
tags/chart_heatmap_takes_time_by_its_cells.php
HTML
tags/chart_heatmap_takes_time_by_its_cells.pad
Result
<?php

// A heatmap's time goes by the cells it has, not by every pair of a row and a column:
// 20,000 rows of a cell each - each its own row and column - took ten seconds.

$cells = [];

for (
$i = 0; $i < 20000; $i++ )
$cells [] = [ 'r' => "r$i", 'c' => "c$i", 'v' => $i % 7 ];

$start = hrtime ( TRUE );

?>
{chart 'heatmap', data='cells', x='c', y='r', value='v' | strlen} {echo hrtime(TRUE) - $start lt 3e9 ? 'in time' : 'too slow'}


App: regression/framework - Page: tags/chart_sankey_takes_time_by_its_links
PHP
tags/chart_sankey_takes_time_by_its_links.php
HTML
tags/chart_sankey_takes_time_by_its_links.pad
Result
<?php

// The flows into a sankey node are looked up by its name, not searched for in every link
// per node: 10,000 nodes and 20,000 links took six seconds.

$flows = [];

for (
$i = 0; $i < 10000; $i++ ) {
$flows [] = [ 's' => "a$i", 't' => "b$i", 'v' => 1 ];
$flows [] = [ 's' => "b$i", 't' => 'c' . ( $i % 100 ), 'v' => 1 ];
}

$start = hrtime ( TRUE );

?>
{chart 'sankey', data='flows', source='s', target='t', value='v', height=2000 | strlen} {echo hrtime(TRUE) - $start lt 3e9 ? 'in time' : 'too slow'}