<?php

 function mtime()
 {
  $mtime = microtime();
  $mtime = str_replace('.', '', $mtime);
  $mtime = explode(' ', $mtime);
  $mtime = $mtime[1] . $mtime[0];

  return($mtime);
 }

  class debug
  {

  function debug()
  {
   $this->start = mtime();
  }

  function reset()
  {
   $all_vars = get_object_vars($this);
   foreach($all_vars as $pos => $val)
    if ($pos != 'error')
     unset($this->$pos);
  }

  function time($text = '')
  {
   $this->break = mtime();
   $time = ($this->break - $this->start) / 1000000000;
   echo number_format($time, 4) .' '. $text ."<br>\n";
   $this->start = $this->break;
  }
  }

  $debug = new debug;

  //-------------------------------------------------------------------

  $debug->time('start');

 // code snippit

  $debug->time('end');

?>

-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]

"Todd Cary" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I want to check the time for queries.  I have

$starttime = getmicrotime();
$endtime = getmicrotime();
$delta = $endtime - $starttime;

How do I display the seconds/milliseconds?

Many thanks..........

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to