PHP Classes

File: tests/test_01.php

Recommend this page to a friend!
  Classes of Pierpaolo  >  INI Manager Improved  >  tests/test_01.php  >  Download  
File: tests/test_01.php
Role: Example script
Content type: text/plain
Description: A test between the original implementation and this one.
Class: INI Manager Improved
Manipulate configuration files in the INI format
Author: By
Last change: Little bugfix (sorry)
Date: 13 years ago
Size: 1,651 bytes


Class file image Download
// This is a simple use of the Alessandro Rosa class (Ini Manager)
// echo get_params_ini( "One", "opt2", "test.ini" ) ;
// This file would compare the performance for a simple parsing and one entry search
// between the two version.
// Please put the Alessandro Rosa package and this class into the same folder of this
// file.
// Than create "test1.ini" and "test2.ini" file and insert into the same content.
// This can avoid performance fake avaluation based on a cache system.
// If you want use the file "test1.ini.example" provided in this packege.

require_once( "ini_fn.php" );
"IniManagerI.class.php" );


$time1 = microtime();

$k=0;$k<$numUsers; $k++){
$iniManagerI = new IniManagerI("test2.ini");
$iniManagerI->get_entry( "One", "opt2" ) ;

$time2 = microtime();

$k=0;$k<$numUsers; $k++){
$ini_path = "test.ini";
$iniMANAGER = new ini_manager();
$iniMANAGER->get_entry( $ini_path, "One", "opt2" ) ;

$time3 = microtime();

$timearray = explode(" ", $millitime);
$microtime=($timearray[1] + $timearray[0])*1000;


Microseconds (improved): <?=microSecondiEffettivi($time2)-microSecondiEffettivi($time1)?> (<?=(microSecondiEffettivi($time2)-microSecondiEffettivi($time1))/1000?> milliseconds)<br />
Microseconds (standard): <?=microSecondiEffettivi($time3)-microSecondiEffettivi($time2)?> (<?=(microSecondiEffettivi($time3)-microSecondiEffettivi($time2))/1000?> milliseconds)<br />

For more information send a message to info at phpclasses dot org.