for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* TPageLoadTime class file.
*
* @author Brad Anderson <[email protected]>
* @link https://github.com/pradosoft/prado
* @license https://github.com/pradosoft/prado/blob/master/LICENSE
* @package Prado\Web\UI\WebControls
*/
namespace Prado\Web\UI\WebControls;
use Prado\Prado;
use Prado\TPropertyValue;
* TPageLoadTime class.
* Writes the amount of time taken from Request start to rendering the contents of this control.
* This is the longest possible time to wait. Localize the appendix "s" with
* {@link setSecondAppendix}.
* @since 4.2.0
class TPageLoadTime extends TLabel
{
* writes the difference in time that the request started to the moment of this method call.
* @param mixed $writer
public function renderContents($writer)
$writer->write(round(microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"], 5) . Prado::localize($this->getSecondAppendix()));
}
* @return string the string that is appended to the time. default 's' for seconds.
public function getSecondAppendix()
return $this->getViewState('Appendix', 's');
* @param string $appendix the string that is appended to the time. default 's' for seconds
public function setSecondAppendix($appendix)
$this->setViewState('Appendix', TPropertyValue::ensureString($appendix), 's');