Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gregory  >  QTemplate  >  test.php  >  Download  
File: test.php
Role: Auxiliary script
Content type: text/plain
Description: 99x99 matrix perfomance test
Class: QTemplate
Template engine that uses regular expressions
Author: By
Last change: new revision
Date: 10 years ago
Size: 1,078 bytes
 

Contents

Class file image Download
<?
////////////////////////////////////////////////////////////////
// QTemplate example :: 99x99 matrix ( perfomance test )
// Produces 9901 call of _warp() function
// (c) Gregory A. Rozanoff, 2003
////////////////////////////////////////////////////////////////

include "class.template.inc";

function 
getmicrotime() { 
    list(
$usec$sec) = explode(" ",microtime()); 
    return ((float)
$usec + (float)$sec); 
}

$start getmicrotime();
$tpl = new template("templates.tpl");
$tpl->assign("title""QTemplate test script :: 100x100 matrix");

for (
$j 1$j 100$j++) {
    
$tpl->reset("entry");
    for (
$i 1$i 100$i++) {
        
$tpl->assign("value"$i $j);
        
$tpl->assign("color"$i == $j "ffff00" "999999");
        
$tpl->assign("font_color"$i == $j "000000" "ffffff");
        
$tpl->assign(".entry");
    }
    
$tpl->assign("index"$j);
    
$tpl->assign(".row");
}

$tpl->assign("main");
echo 
$tpl->out("main");

$stop getmicrotime();
$uptime round(($stop $start) * 1000000) / 1000;
echo 
"\n<!-- Execution time : ".$uptime." mc -->";
?>