steffen: server/kolab-horde-framework/kolab-horde-framework/Timer Timer.php, NONE, 1.1 package.xml, NONE, 1.1

cvs at intevation.de cvs at intevation.de
Fri Oct 14 16:33:15 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolab-horde-framework/kolab-horde-framework/Timer
In directory doto:/tmp/cvs-serv28903/kolab-horde-framework/kolab-horde-framework/Timer

Added Files:
	Timer.php package.xml 
Log Message:
Separated Horde Framework from kolab-resource-handlers

--- NEW FILE: Timer.php ---
<?php
/**
 * Horde_Timer
 *
 * Simpler interface for timing operations/actions.
 *
 * $Horde: framework/Timer/Timer.php,v 1.4 2003/11/06 19:44:07 chuck Exp $
 *
 * @package Horde_Timer
 * @since   Horde 3.0
 * @version $Revision: 1.1 $
 */
class Horde_Timer {

    var $_start = array();
    var $_idx = 0;

    /**
     * Push a new timer start on stack.
     */
    function push()
    {
        list($ms, $s) = explode(' ', microtime());
        $this->_start[$this->_idx++] = floor($ms * 1000) + 1000 * $s;
    }

    /**
     * Pop the latest timer start and return the difference with the
     * current time.
     */
    function pop()
    {
        assert($this->_idx > 0);
        list($ms, $s) = explode(' ', microtime());
        $etime = floor($ms * 1000) + (1000 * $s);
        $this->_idx--;
        return $etime - $this->_start[$this->_idx];
    }

    /**
     * Return a reference to a global Horde_Timer engine.
     */
    function &singleton()
    {
        static $timer;

        if (!isset($timer)) {
            $timer = new Horde_Timer();
        }

        return $timer;
    }

}

--- NEW FILE: package.xml ---
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $Horde: framework/Timer/package.xml,v 1.4 2003/12/12 17:46:39 slusarz Exp $ -->
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.1">
<package version="1.0">
  <name>Horde_Timer</name>
  <summary>Horde Timer API</summary>
  <description>
The Horde_Timer:: class provide a simple interface for timing operations/actions.
  </description>
  <license>LGPL</license>
  <maintainers>
    <maintainer>
      <user>chuck</user>
      <role>lead</role>
      <name>Chuck Hagenbuch</name>
      <email>chuck at horde.org</email>
    </maintainer>
  </maintainers>
  <release>
    <version>0.0.1</version>
    <state>alpha</state>
    <date>2003-07-05</date>
    <notes>Initial Release.</notes>
    <filelist>
      <file role="php" baseinstalldir="/Horde" name="Timer.php" />
    </filelist>
  </release>

  <changelog>
    <release>
      <version>0.0.1</version>
      <date>2003-07-05</date>
      <state>alpha</state>
      <notes>Initial release as a PEAR package</notes>
    </release>
  </changelog>

</package>





More information about the commits mailing list