100+ results for 'php microtime'

Not the results you expected?

ProgressBarTest.php (https://github.com/mako-framework/framework.git) PHP · 369 lines

1 <?php

2

3 /**

53 $output->shouldReceive('write')->once()->with("\r09/10 ==================-- 90% ");

54 $output->shouldReceive('write')->once()->with("\r10/10 ==================== 100% ");

55 $output->shouldReceive('write')->once()->with(PHP_EOL);

56

57 $progressBar = new class ($output, 10) extends ProgressBar

90 $output->shouldReceive('write')->once()->with("\r09/10 ====================================---- 90% ");

91 $output->shouldReceive('write')->once()->with("\r10/10 ======================================== 100% ");

92 $output->shouldReceive('write')->once()->with(PHP_EOL);

93

94 $progressBar = new class ($output, 10) extends ProgressBar

129 $output->shouldReceive('write')->once()->with("\r09/10 ++++++++++++++++++__ 90% ");

130 $output->shouldReceive('write')->once()->with("\r10/10 ++++++++++++++++++++ 100% ");

131 $output->shouldReceive('write')->once()->with(PHP_EOL);

132

133 $progressBar = new class ($output, 10) extends ProgressBar

List.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 271 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Catalog

23 * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

181 }

182 }

183 $block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime());

184 return $block;

185 }

ezbenchmarkrunner.php (https://github.com/eeggenberger/ezpublish.git) PHP · 293 lines

1 <?php

2 /**

3 * File containing the eZBenchmarkrunner class.

10

11 /*!

12 \class eZBenchmarkrunner ezbenchmarkrunner.php

13 \brief The class eZBenchmarkrunner does

14

100 {

101 $entry['prime_start'] = array( 'memory' => memory_get_usage(),

102 'time' => microtime() );

103 $object->prime( $this );

104 $entry['prime_end'] = array( 'memory' => memory_get_usage(),

105 'time' => microtime() );

106 }

107

NestedTreeRootTest.php (https://github.com/kaiwa/DoctrineExtensions.git) PHP · 337 lines

1 <?php

2

3 namespace Gedmo\Tree;

14 * @package Gedmo.Tree

15 * @link http://www.gediminasm.org

16 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)

17 */

18 class NestedTreeRootTest extends BaseTestCaseORM

33 /*public function testHeavyLoad()

34 {

35 $start = microtime(true);

36 $dumpTime = function($start, $msg) {

37 $took = microtime(true) - $start;

38 $minutes = intval($took / 60); $seconds = $took % 60;

39 echo sprintf("%s --> %02d:%02d", $msg, $minutes, $seconds) . PHP_EOL;

40 };

41 $repo = $this->em->getRepository(self::CATEGORY);

PhpBackend.php (https://gitlab.com/reasonat/test8) PHP · 271 lines

3 namespace Drupal\Core\Cache;

4

5 use Drupal\Core\PhpStorage\PhpStorageFactory;

6 use Drupal\Component\Utility\Crypt;

7

11 * Stores cache items in a PHP file using a storage that implements

12 * Drupal\Component\PhpStorage\PhpStorageInterface.

13 *

14 * This is fast because of PHP's opcode caching mechanism. Once a file's

19 * @ingroup cache

20 */

21 class PhpBackend implements CacheBackendInterface {

22

23 /**

247 * Gets the PHP code storage object to use.

248 *

249 * @return \Drupal\Component\PhpStorage\PhpStorageInterface

250 */

251 protected function storage() {

Mandrill.php (https://gitlab.com/x33n/platform) PHP · 118 lines

1 <?php

2 class Mandrill {

3

27

28 $this->ch = curl_init();

29 curl_setopt($this->ch, CURLOPT_USERAGENT, 'like Mandrill-PHP/1.0.18');

30 curl_setopt($this->ch, CURLOPT_POST, true);

31 curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);

52 curl_setopt($ch, CURLOPT_VERBOSE, $this->debug);

53

54 $start = microtime(true);

55 $this->log('Call to ' . $this->root . $url . '.json: ' . $params);

56 if($this->debug) {

57 $curl_buffer = fopen('php://memory', 'w+');

58 curl_setopt($ch, CURLOPT_STDERR, $curl_buffer);

59 }

AdminController.php (https://github.com/joshuaswarren/weatherhub.git) PHP · 165 lines

1 <?php

2

3 class AdminController extends Controller

72 {

73 $model->attributes=$_POST['User'];

74 $model->activkey=Yii::app()->controller->module->encrypting(microtime().$model->password);

75 $model->createtime=time();

76 $model->lastvisit=time();

110 if ($old_password->password!=$model->password) {

111 $model->password=Yii::app()->controller->module->encrypting($model->password);

112 $model->activkey=Yii::app()->controller->module->encrypting(microtime().$model->password);

113 }

114 $model->save();

stress_test.php (https://github.com/amcl/openemr.git) PHP · 419 lines

6 <body>

7 <pre>

8 <?php

9

10 /*! var

30 get time accurate to the nearest microsecond, used for script timing

31 !*/

32 function getmicrotime ()

33 {

34 list ($usec, $sec) = explode (' ', microtime ());

60

61 // require gacl

62 require_once (dirname (__FILE__) . '/../admin/gacl_admin.inc.php');

63

64 /*

Log.php (https://github.com/botskonet/aspen-framework.git) PHP · 259 lines

1 <?php

2

3 /**

71 if($loaded){

72

73 $this->write('Logging has been activated at ' . Date::formatMicrotime(Date::microtime(EXECUTION_START)) . '.', 'w');

74

75 if($this->level == 1){

112

113 if(config()->get('timestamp_log_file')){

114 $new_filename .= '-' . Date::formatMicrotime(Date::microtime(EXECUTION_START));

115 }

116

ArrayStorage.php (https://github.com/MontmereLimited/zf2.git) PHP · 345 lines

1 <?php

2 /**

3 * Zend Framework

62 {

63 parent::__construct($input, $flags, $iteratorClass);

64 $this->setMetadata('_REQUEST_ACCESS_TIME', microtime(true));

65 }

66

Dispatcher.php (https://gitlab.com/isdzulqor/Slis-Dev) PHP · 201 lines

1 <?php

2 /**

3 * @link http://www.yiiframework.com/

22 * You may configure the targets in application configuration, like the following:

23 *

24 * ```php

25 * [

26 * 'components' => [

47 * Each log target can have a name and can be referenced via the [[targets]] property as follows:

48 *

49 * ```php

50 * Yii::$app->log->targets['file']->enabled = false;

51 * ```

188 Logger::LEVEL_WARNING,

189 __METHOD__,

190 microtime(true),

191 [],

192 ];

Chive.class.php (https://github.com/advocaite/Stargate-Wars.git) PHP · 201 lines

1 <?php

2 // Base::Chive.class.php

179 //

180 function start() {

181 $microstart = explode(' ',microtime());

182 $this->_start_time = $microstart[0] + $microstart[1];

183 }

187 //

188 function stop() {

189 $microstop = explode(' ',microtime());

190 $this->_stop_time = $microstop[0] + $microstop[1];

191 }

conditionals.php (https://github.com/andrewmriley/PHP-Speed-Tests.git) PHP · 303 lines

1 <?php

2 $total_loops = 1000000;

3 $some_result = false;

4

5 $time_start = microtime(true);

6 for($x = 0; $x < $total_loops; $x++) {

7 if(true) {

11 }

12 }

13 $time_end = microtime(true);

14 $t = $time_end - $time_start;

15 echo '(if true) time: ' . $t . "\n";

17

18

19 $time_start = microtime(true);

20 for($x = 0; $x < $total_loops; $x++) {

21 if(false) {

captcha_helper.rst (https://github.com/dchill42/CodeIgniter.git) ReStructuredText · 143 lines

21 ================

22

23 .. php:function:: function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '')

24

25 :param array $data: Array of data for the CAPTCHA

37 array(

38 'image' => IMAGE TAG

39 'time' => TIMESTAMP (in microtime)

40 'word' => CAPTCHA WORD

41 )

init.php (https://bitbucket.org/simancms/simancms.git) PHP · 140 lines

1 <?php

2

3 //------------------------------------------------------------------------------

66

67 $special['main_tpl'] = 'index';

68 $special['page_url'] = 'index.php';

69 if (!empty($_servervars['QUERY_STRING']))

70 $special['page_url'] .= '?'.$_servervars['QUERY_STRING'];

127 $sm['other']['includedlanguages']=[];

128

129 $sm['s']['page_system_id'] = 'smp'.microtime(true).$sm['s']['rand'];

130 $sm['s']['customcss']=[];

131 $sm['s']['cssfiles']=[];

MinkTestCase.php (https://gitlab.com/x33n/ImpressPages) PHP · 203 lines

1 <?php

2

3

4 namespace PhpUnit\Helper;

5

6

7 class MinkTestCase extends \PHPUnit_Framework_TestCase

8 {

9 /**

41 public function tearDown()

42 {

43 static::stopSession($this->session, $this->getStatus() == \PHPUnit_Runner_BaseTestRunner::STATUS_PASSED);

44

45 $this->session = null;

Message.php (https://github.com/eschabell/openshift-zendframework.git) PHP · 246 lines

1 <?php

2 /**

3 * Zend Framework

18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

19 * @license http://framework.zend.com/license/new-bsd New BSD License

20 * @version $Id: Message.php 23775 2011-03-01 17:25:24Z ralph $

21 */

22

23

24 /**

25 * A message envelope that can be passed to Zend_Wildfire_Plugin_FirePhp to be

26 * logged to Firebug instead of a variable.

27 *

32 * @license http://framework.zend.com/license/new-bsd New BSD License

33 */

34 class Zend_Wildfire_Plugin_FirePhp_Message

35 {

36 /**

Profiler.php (https://gitlab.com/php.bjoernbartels.earth/profiler) PHP · 569 lines

194 * @access public

195 * @return integer

196 * @see http://php.net/manual/de/function.memory-get-usage.php

197 */

198 public static function getMemoryUsage()

220 * @param boolean $use

221 * @return Profiler

222 * @see http://php.net/manual/de/function.memory-get-usage.php

223 */

224 public function setRealMemoryUsage($use = true)

233 * @access public

234 * @return boolean

235 * @see http://php.net/manual/de/function.memory-get-usage.php

236 */

237 public function getRealMemoryUsage()

AbstractSessionArrayStorage.php (https://github.com/cgmartin/zf2.git) PHP · 487 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

54 }

55 $_SESSION = $input;

56 $this->setRequestAccessTime(microtime(true));

57 }

58

Form.php (https://github.com/xsist10/meta-builder.git) PHP · 213 lines

1 <?php

2

3 /*

172 public function Render($aMeta, $aData = array())

173 {

174 $aTimer['Start'] = microtime(true);

175

176 $this->sResult = '';

184 $this->SetConfig($aMeta, $aData);

185

186 $sAction = !empty($aMeta['script']) ? $aMeta['script'] : 'form.php';

187

188 $this->sResult .= "<form method=\"post\" ". $this->___GetFormEncoding($aMeta) ." action=\"" . BuildUrl($sAction) ."\" id=\"" . $aMeta['identity'] . "\">\n";

206 $this->sResult .= "</form>\n";

207

208 $aTimer['End'] = microtime(true);

209 // $this->sResult .= '<div class="timer">Time taken to generate: ' . ($aTimer['End'] - $aTimer['Start']) . 's </div>';

210

profiler.php (https://github.com/Sipcms/SipCMS.git) PHP · 385 lines

1 <?php defined('SYSPATH') or die('No direct script access.');

2 /**

3 * Provides simple benchmarking and profiling. To display the statistics that

47

48 // Start the benchmark

49 'start_time' => microtime(TRUE),

50 'start_memory' => memory_get_usage(),

51

69 {

70 // Stop the benchmark

71 Profiler::$_marks[$token]['stop_time'] = microtime(TRUE);

72 Profiler::$_marks[$token]['stop_memory'] = memory_get_usage();

73 }

283 {

284 // The benchmark has not been stopped yet

285 $mark['stop_time'] = microtime(TRUE);

286 $mark['stop_memory'] = memory_get_usage();

287 }

wrapper.php (https://gitlab.com/webkod3r/tripolis) PHP · 213 lines

1 <?php

2

3 global $wpcom_api_key, $akismet_api_host, $akismet_api_port;

17 }

18

19 function akismet_microtime() {

20 return Akismet::_get_microtime();

func.php (https://gitlab.com/Oasisnejeb/yml_helper_for_cs-cart) PHP · 132 lines

1 <?php

2

3 if ( !defined('AREA') ) { die('Access denied'); }

10

11 function fn_yml_helper_check_products () {

12 $start = microtime(true);

13 $options = Registry::get('addons.yml_helper');

14 $yml_pickup = $options['yml_helper_yml_pickup'];

122 }

123 if ($disable_disabled) db_query("UPDATE ?:products SET ?u WHERE status = ?s", $deny_product, 'D');

124 fn_print_r('Время выполнения : '.(microtime(true) - $start).' сек.');

125 }

126

micro_bench.php (https://bitbucket.org/gnanakeethan/php-src.git) PHP · 358 lines

1 <?php

2

3 function hallo() {

239 }

240

241 function getmicrotime()

242 {

243 $t = gettimeofday();

248 {

249 ob_start();

250 return getmicrotime();

251 }

252

255 global $total;

256 global $last_time;

257 $end = getmicrotime();

258 ob_end_clean();

259 $last_time = $end-$start;

Communicate.php (https://github.com/ichraffsnicht/ClanSphere-Enhanced.git) PHP · 218 lines

1 <?php

2 /**

3 * This file is part of GameQ.

16 * along with this program. If not, see <http://www.gnu.org/licenses/>.

17 *

18 * $Id: Communicate.php,v 1.12 2009/10/20 20:34:22 evilpie Exp $

19 */

20

23 * Handles all communication with the gameservers

24 *

25 * @author Aidan Lister <aidan@php.net>

26 * @author Tom Buskens <t.buskens@deviation.nl>

27 * @version $Revision: 1.12 $

152 $maxloops = 50;

153 $result = array();

154 $starttime = microtime(true);

155 $r = $this->sockets;

156 $w = null;

pp_payflow_iframe.php (https://gitlab.com/shapcy/opencart) PHP · 153 lines

1 <?php

2 class ControllerPaymentPPPayflowIframe extends Controller {

3 public function index() {

23 }

24

25 $secure_token_id = md5($this->session->data['order_id'] . mt_rand() . microtime());

26

27 $this->model_payment_pp_payflow_iframe->addOrder($order_info['order_id'], $secure_token_id);

crypt.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 238 lines

1 <?php

2 /**

3 * @package Joomla.Platform

121 /*

122 * if a secure randomness generator exists and we don't

123 * have a buggy PHP version use it.

124 */

125 if (function_exists('openssl_random_pseudo_bytes')

126 && (version_compare(PHP_VERSION, '5.3.4') >= 0 || IS_WIN))

127 {

128 $sslStr = openssl_random_pseudo_bytes($length, $strong);

147 $handle = null;

148

149 // This is PHP 5.3.3 and up

150 if (function_exists('stream_set_read_buffer') && @is_readable('/dev/urandom'))

151 {

profiler.php (https://bitbucket.org/artdevue/laravel-3.2.14.git) PHP · 186 lines

1 <?php namespace Laravel\Profiling;

2

3 use Laravel\View;

32 static::$data['memory'] = get_file_size(memory_get_usage(true));

33 static::$data['memory_peak'] = get_file_size(memory_get_peak_usage(true));

34 static::$data['time'] = number_format((microtime(true) - LARAVEL_START) * 1000, 2);

35 foreach ( static::$data['timers'] as &$timer)

36 {

37 $timer['running_time'] = number_format((microtime(true) - $timer['start'] ) * 1000, 2);

38 }

39

52 {

53 // First measure the runtime of the func

54 $start = microtime(true);

55 $func();

56 $end = microtime(true);

WidgetDetailEvent.php (https://gitlab.com/mautic-master/mautic) PHP · 299 lines

1 <?php

2 /**

3 * @package Mautic

44 {

45 $this->translator = $translator;

46 $this->startTime = microtime();

47 }

48

162 $this->templateData = $templateData;

163 $this->widget->setTemplateData($templateData);

164 $this->widget->setLoadTime(abs(microtime() - $this->startTime));

165

166 // Store the template data to the cache

function.config_load.php (https://github.com/atutor/phpdoc2.git) PHP · 130 lines

1 <?php

2 /**

3 * Smarty plugin

12 * Name: config_load<br>

13 * Purpose: load config file vars

14 * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load}

15 * (Smarty online manual)

16 * @param array Format:

27 if ($smarty->debugging) {

28 $_params = array();

29 require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');

30 $_debug_start_time = smarty_core_get_microtime($_params, $smarty);

117 if ($smarty->debugging) {

118 $_params = array();

119 require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');

120 $smarty->_smarty_debug_info[] = array('type' => 'config',

121 'filename' => $_file.' ['.$_section.'] '.$_scope,

console.php (https://github.com/sseshachala/Open-Web-Analytics.git) PHP · 208 lines

1 <?php

2 /**

3 * $Header$

11 * abstract class which writes message to the text console.

12 *

13 * @author Jon Parise <jon@php.net>

14 * @since Log 1.1

15 * @package Log

16 *

17 * @example console.php Using the console handler.

18 */

19 class Log_console extends Log

68 $level = PEAR_LOG_DEBUG)

69 {

70 $this->_id = md5(microtime());

71 $this->_ident = $ident;

72 $this->_mask = Log::UPTO($level);

TestRunner.php (https://github.com/masicek/XSLT-Benchmarking-XSLTMark-II.git) PHP · 215 lines

1 <?php

2

3 /**

10 namespace XSLTBenchmarking\TestsRunner;

11

12 require_once ROOT . '/Microtime.php';

13 require_once ROOT . '/Exceptions.php';

14 require_once LIBS . '/PhpPath/PhpPath.min.php';

15 require_once ROOT . '/Printer.php';

16

17 use PhpPath\P;

18 use XSLTBenchmarking\Printer;

19

156 // unique filename

157 $pathInfo = pathinfo($expectedOutputPath);

158 $microtime = \XSLTBenchmarking\Microtime::now();

159 $microtime = str_replace('.', '-', $microtime);

CurlMultiHandler.php (https://gitlab.com/ealexis.t/trends) PHP · 197 lines

1 <?php

2 namespace GuzzleHttp\Handler;

3

81 // Add any delayed handles if needed.

82 if ($this->delays) {

83 $currentTime = microtime(true);

84 foreach ($this->delays as $id => $delay) {

85 if ($currentTime >= $delay) {

100 ) {

101 // Perform a usleep if a select returns -1.

102 // See: https://bugs.php.net/bug.php?id=61141

103 usleep(250);

104 }

133 curl_multi_add_handle($this->_mh, $easy->handle);

134 } else {

135 $this->delays[$id] = microtime(true) + ($easy->options['delay'] / 1000);

136 }

137 }

StopwatchEvent.php (https://github.com/nattaphat/hgis.git) PHP · 218 lines

1 <?php

2

3 /*

196 protected function getNow()

197 {

198 return $this->formatTime(microtime(true) * 1000 - $this->origin);

199 }

200

window.php (https://github.com/codepassive/dev-nimbus.git) PHP · 160 lines

1 <?php

2 /**

3 * Nimbus - Manage, Share & Collaborate

37 public function __construct($options = array()){

38 parent::__construct(array(

39 'id' => 'window-' . generateHash(microtime()),

40 'classes' => array(),

41 'type' => 0, //Application(0) or Dialog(1)

136 if (is_array($button)) {

137 //For the OK or proceed button

138 $hash = generateHash(microtime());

139 $id = $this->handle . '-button-' . $hash;

140 $output .= '<input type="button" value="' . $button[0] . '" id="' . $id . '" class="button"/>&nbsp;';

ClassMapGeneratorTest.php (https://gitlab.com/pr0055/symfonypizza) PHP · 145 lines

83 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',

84 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php',

85 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php',

106 array(__DIR__.'/Fixtures/php5.4', array(

107 'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php',

108 'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php',

109 'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php',

110 'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php',

111 'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',

112 'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',

113 )),

114 array(__DIR__.'/Fixtures/php5.5', array(

115 'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php',

116 )),

117 );

Temp.php (https://github.com/piece/stagehand-temp.git) PHP · 169 lines

1 <?php

2 /**

3 * PHP version 5

29 * @package Stagehand_Temp

30 * @copyright 2011 KUMAKURA Yousuke <kumatch@gmail.com>

31 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License

32 * @version Release: @package_version@

33 * @since File available since Release 1.0.0

42 * @package Stagehand_Temp

43 * @copyright 2011 KUMAKURA Yousuke <kumatch@gmail.com>

44 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License

45 * @version Release: @package_version@

46 * @since File available since Release 1.0.0

161 protected function _generateName($prefix = null)

162 {

163 $a = base_convert(microtime(true), 10, 36);

164 $b = base_convert((mt_rand() / mt_getrandmax()), 10, 36);

165 $c = base_convert((mt_rand() / mt_getrandmax()), 10, 36);

Numbers.php (https://github.com/arphp/I18N_Arabic.git) PHP · 288 lines

12 <div class="Paragraph" dir="rtl">

13 <h2 dir="ltr">Example Output 1: المعدود مذكر مرفوع</h2>

14 <?php

15 /**

16 * Example of Spell numbers in the Arabic idiom

18 * @category I18N

19 * @package I18N_Arabic

20 * @author Khaled Al-Sham'aa <khaled@ar-php.org>

21 * @copyright 2006-2016 Khaled Al-Sham'aa

22 *

23 * @license LGPL <http://www.gnu.org/licenses/lgpl.txt>

24 * @link http://www.ar-php.org

25 */

26

OAuthStoreAbstract.class.php (https://github.com/wangaiying/elgg4ysu.git) PHP · 149 lines

1 <?php

2

3 /**

93 if ($unique)

94 {

95 list($usec,$sec) = explode(' ',microtime());

96 $key .= dechex($usec).dechex($sec);

97 }

31docproperties_write.php (https://gitlab.com/rayhankhan/web-bitm-php) PHP · 119 lines

37 /** Include PHPExcel */

38 require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';

39

40

48 $objPHPExcelReader = PHPExcel_IOFactory::createReader($inputFileType);

49 $objPHPExcel = $objPHPExcelReader->load($inputFileName);

50

51 $callEndTime = microtime(true);

65 // Save Excel 2007 file

66 echo date('H:i:s') , " Write to Excel2007 format" , EOL;

67 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

68 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));

77 // Reread File

78 echo date('H:i:s') , " Reread Excel2007 file" , EOL;

79 $objPHPExcelRead = PHPExcel_IOFactory::load(str_replace('.php', '.xlsx', __FILE__));

80

81 // Set properties

CategoriesControllerTest.php (https://github.com/servergrove/ServerGroveKbBundle.git) PHP · 147 lines

1 <?php

2

3 namespace ServerGrove\KbBundle\Tests\Controller\Admin;

101

102 $form = $crawler->selectButton('Save')->form();

103 $name = 'New name '.md5(microtime(true));

104

105 $form['category_translation_en[name]'] = $name;

subscriptions.php (https://github.com/AndyRixon/LayerBulletin.git) PHP · 246 lines

1 <?php

2 /*

3 +--------------------------------------------------------------------------

9 | ========================================

10 |+--------------------------------------------------------------------------

11 | subscriptions.php - create/edit/delete Paypal subscriptions

12 */

13

17 }

18

19 template_hook("pages/admin/subscriptions.template.php", "start");

20

21 if($_GET['success']=="created"){

22 template_hook("pages/admin/subscriptions.template.php", "successCreated");

23 }elseif($_GET['success']=="updated"){

24 template_hook("pages/admin/subscriptions.template.php", "successUpdated");

StandardTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 160 lines

1 <?php

2 /**

3 * Test class for \Magento\Framework\Profiler\Driver\Standard

8 namespace Magento\Framework\Profiler\Test\Unit\Driver;

9

10 class StandardTest extends \PHPUnit_Framework_TestCase

11 {

12 /**

13 * @var \Magento\Framework\Profiler\Driver\Standard\Stat|PHPUnit_Framework_MockObject_MockObject

14 */

15 protected $_stat;

60 )->with(

61 'timer_id',

62 $this->greaterThanOrEqual(microtime(true)),

63 $this->greaterThanOrEqual(0),

64 $this->greaterThanOrEqual(0)

Timer.php (https://bitbucket.org/rybadour/todo_list_site.git) PHP · 159 lines

1 <?php

2 /**

3 * PHP_Timer

35 * POSSIBILITY OF SUCH DAMAGE.

36 *

37 * @package PHP

38 * @subpackage Timer

39 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>

40 * @copyright 2010-2012 Sebastian Bergmann <sb@sebastian-bergmann.de>

41 * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License

42 * @link http://github.com/sebastianbergmann/php-timer

43 * @since File available since Release 1.0.0

44 */

47 * Utility class for timing.

48 *

49 * @package PHP

50 * @subpackage Timer

51 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>

firebug.php (https://github.com/sseshachala/Open-Web-Analytics.git) PHP · 214 lines

1 <?php

2 /**

3 * $Header$

17 * @package Log

18 *

19 * @example firebug.php Using the firebug handler.

20 */

21 class Log_firebug extends Log

79 * @access public

80 */

81 function Log_firebug($name = '', $ident = 'PHP', $conf = array(),

82 $level = PEAR_LOG_DEBUG)

83 {

84 $this->_id = md5(microtime());

85 $this->_ident = $ident;

86 $this->_mask = Log::UPTO($level);

HttpCacheListener.php (https://gitlab.com/Isaki/le331.fr) PHP · 168 lines

1 <?php

2

3 /*

97 if (null !== $age = $configuration->getSMaxAge()) {

98 if (!is_numeric($age)) {

99 $now = microtime(true);

100

101 $age = ceil(strtotime($configuration->getSMaxAge(), $now) - $now);

107 if (null !== $age = $configuration->getMaxAge()) {

108 if (!is_numeric($age)) {

109 $now = microtime(true);

110

111 $age = ceil(strtotime($configuration->getMaxAge(), $now) - $now);

index.php (https://github.com/xmmedia/xm_template.git) PHP · 136 lines

1 <?php

2

3 // include the config file

4 // for each server, replace this file with the correct config

5 require_once('../application/init.php');

6

7 // set the upload paths based on the ABS root

12

13 /**

14 * Set the PHP error reporting level. If you set this in php.ini, you remove this.

15 * @see http://php.net/error_reporting

21 * Disable them by using: E_ALL ^ E_NOTICE

22 *

23 * When using a legacy application with PHP >= 5.3, it is recommended to disable

24 * deprecated notices. Disable with: E_ALL & ~E_DEPRECATED

25 */

check-environment.php (https://github.com/Exercise/zf2.git) PHP · 323 lines

25 ini_set('default_socket_timeout', SOCKET_TIMEOUT);

26

27 printf('%sEnvironment Checker for Zend Framework LiveDocx Component%s%s', PHP_EOL, PHP_EOL, PHP_EOL);

28

29 // -----------------------------------------------------------------------------

42 }

43

44 Helper::printCheckEnvironmentLine($counter, sprintf('Checking PHP version (%s)', PHP_VERSION), $result);

45

46 $counter ++;

319 }

320

321 Helper::printLine(PHP_EOL . $message . PHP_EOL . PHP_EOL);

322

323 // -----------------------------------------------------------------------------

ABackend.php (https://gitlab.com/rsilveira1987/Expresso) PHP · 203 lines

1 <?php

2 /**

3 * Syncroton

59 $data = $this->_convertModelToArray($model);

60

61 $data['id'] = sha1(mt_rand(). microtime());

62

63 $this->_db->insert($this->_tablePrefix . $this->_tableName, $data);

109 $stmt = $this->_db->query($select);

110 $data = $stmt->fetch();

111 $stmt = null; # see https://bugs.php.net/bug.php?id=44081

112 } catch (Zend_Db_Statement_Exception $zdbse) {

113 throw new Syncroton_Exception_NotFound('id not found');

143

144 /**

145 * (non-PHPdoc)

146 * @see Syncroton_Backend_IBackend::delete()

147 */

footer.php (https://gitlab.com/LibreTitan/Panther) PHP · 181 lines

1 <?php

2 /**

3 * Copyright (C) 2015 Panther (https://www.pantherforum.org)

47 ob_start();

48 // Load cached quick jump

49 if (file_exists(FORUM_CACHE_DIR.'cache_quickjump_'.$panther_user['g_id'].'.php'))

50 require FORUM_CACHE_DIR.'cache_quickjump_'.$panther_user['g_id'].'.php';

53 {

54 if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))

55 require PANTHER_ROOT.'include/cache.php';

56

57 generate_quickjump_cache($panther_user['g_id']);

58 require FORUM_CACHE_DIR.'cache_quickjump_'.$panther_user['g_id'].'.php';

59 }

60

ref.datetime.html (https://github.com/vsilent/vim.git) HTML · 274 lines

9 <div class="next" style="float: right;"><a href="function.checkdate.html">checkdate</a></div>

10 <div class="up"><a href="book.datetime.html">Date and Time</a></div>

11 <div class="home"><a href="index.html">PHP Manual</a></div>

12 </div><hr /><div>

13 <h1 class="title">Date and Time Функции</h1>

265

266

267 <h2>Содержание</h2><ul class="chunklist chunklist_reference"><li><a href="function.checkdate.html">checkdate</a> — Проверяет правильность даты по грегорианскому календарю</li><li><a href="function.date-create.html">date_create</a> — Returns new DateTime object</li><li><a href="function.date-date-set.html">date_date_set</a> — Sets the date</li><li><a href="function.date-default-timezone-get.html">date_default_timezone_get</a> — Gets the default timezone used by all date/time functions in a script</li><li><a href="function.date-default-timezone-set.html">date_default_timezone_set</a> — Sets the default timezone used by all date/time functions in a script</li><li><a href="function.date-format.html">date_format</a> — Returns date formatted according to given format</li><li><a href="function.date-isodate-set.html">date_isodate_set</a> — Sets the ISO date</li><li><a href="function.date-modify.html">date_modify</a> — Alters the timestamp</li><li><a href="function.date-offset-get.html">date_offset_get</a> — Returns the daylight saving time offset</li><li><a href="function.date-parse.html">date_parse</a> — Returns associative array with detailed info about given date</li><li><a href="function.date-sun-info.html">date_sun_info</a> — Returns an array with information about sunset/sunrise and twilight begin/end</li><li><a href="function.date-sunrise.html">date_sunrise</a> — Returns time of sunrise for a given day and location</li><li><a href="function.date-sunset.html">date_sunset</a> — Returns time of sunset for a given day and location</li><li><a href="function.date-time-set.html">date_time_set</a> — Sets the time</li><li><a href="function.date-timezone-get.html">date_timezone_get</a> — Return time zone relative to given DateTime</li><li><a href="function.date-timezone-set.html">date_timezone_set</a> — Sets the time zone for the DateTime object</li><li><a href="function.date.html">date</a> — Форматирует системную дату/время</li><li><a href="function.getdate.html">getdate</a> — Возвращает информацию о дате/времени</li><li><a href="function.gettimeofday.html">gettimeofday</a> — Возвращает текущее время</li><li><a href="function.gmdate.html">gmdate</a> — Форматирует дату/время по Гринвичу</li><li><a href="function.gmmktime.html">gmmktime</a> — Возвращает метку времени Unix для времени по Гринвичу</li><li><a href="function.gmstrftime.html">gmstrftime</a> — Форматирует дату/время по Гринвичу с учетом текущей локали</li><li><a href="function.idate.html">idate</a> — Format a local time/date as integer</li><li><a href="function.localtime.html">localtime</a> — Возвращает системное время</li><li><a href="function.microtime.html">microtime</a> — Возвращает метку времени с микросекундами</li><li><a href="function.mktime.html">mktime</a> — Возвращает метку времени для заданной даты</li><li><a href="function.strftime.html">strftime</a> — Форматирует текущую дату/время с учетом текущей локали</li><li><a href="function.strptime.html">strptime</a> — Parse a time/date generated with strftime</li><li><a href="function.strtotime.html">strtotime</a> — Преобразует текстовое представление даты на английском языке в метку времени Unix</li><li><a href="function.time.html">time</a> — Возвращает текущую метку времени</li><li><a href="function.timezone-abbreviations-list.html">timezone_abbreviations_list</a> — Returns associative array containing dst, offset and the timezone name</li><li><a href="function.timezone-identifiers-list.html">timezone_identifiers_list</a> — Returns numerically index array with all timezone identifiers</li><li><a href="function.timezone-name-from-abbr.html">timezone_name_from_abbr</a> — Returns the timezone name from abbrevation</li><li><a href="function.timezone-name-get.html">timezone_name_get</a> — Returns the name of the timezone</li><li><a href="function.timezone-offset-get.html">timezone_offset_get</a> — Returns the timezone offset from GMT</li><li><a href="function.timezone-open.html">timezone_open</a> — Returns new DateTimeZone object</li><li><a href="function.timezone-transitions-get.html">timezone_transitions_get</a> — Returns all transitions for the timezone</li></ul>

268 </div>

269 <hr /><div style="text-align: center;">

271 <div class="next" style="float: right;"><a href="function.checkdate.html">checkdate</a></div>

272 <div class="up"><a href="book.datetime.html">Date and Time</a></div>

273 <div class="home"><a href="index.html">PHP Manual</a></div>

274 </div></body></html>

275

List.php (https://gitlab.com/axeltizon/magentoV1.9-demopoweraccess) PHP · 271 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Catalog

23 * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

181 }

182 }

183 $block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime());

184 return $block;

185 }

new_demo.php (https://bitbucket.org/michaelku/tumblr-note-stats-v2.git) PHP · 260 lines

1 <?php

2

3 /**********************************/

6

7 //START TIMER #1

8 $time = microtime();

9 $time = explode(' ', $time);

10 $time = $time[1] + $time[0];

101

102 //STOP TIMER #1

103 $time = microtime();

104 $time = explode(' ', $time);

105 $time = $time[1] + $time[0];

113

114 //START TIMER #2

115 $time = microtime();

116 $time = explode(' ', $time);

117 $time = $time[1] + $time[0];

tokenmissing.php (https://github.com/mysnip/Core.git) PHP · 106 lines

1 <?php

2

3 ////////////////////////////////////////////////////////////////////////////////

58 $admin_token = phorum_api_sign(

59 $PHORUM['user']['user_id'].

60 microtime().

61 $PHORUM['user']['username'].

62 $PHORUM['user']['sessid_st']

92 You are accessing the admin after a security timeout.<br /><br />

93 The requested URL was:

94 <pre><?php echo $target_html;?></pre><br />

95 <strong>Please make sure that you really want to access this URL and weren't tricked to go to the admin.</strong><br />

96 Please click on <strong>continue</strong> to go to this URL or on <strong>cancel</strong> to go to the forum homepage.

97 <br /><br />

98 <form action="<?php echo $post_url;?>" method="POST">

99 <input type="hidden" name="module" value="tokenmissing" />

100 <input type="hidden" name="phorum_admin_token" value="<?php echo $PHORUM["user"]['settings_data']['admin_token'];?>" />

Timers.php (https://github.com/ivebeenlinuxed/Boiler.git) PHP · 104 lines

1 <?php

2

3 namespace React\EventLoop\Timer;

23 public function updateTime()

24 {

25 return $this->time = microtime(true);

26 }

27

utlTemplate.php (https://github.com/fmake/fmake.git) PHP · 126 lines

1 <?php

2

3 class utlTemplate

6 public static $tplDir = "template";

7

8 public static $phpExt = ".php";

9 public static $phpDir = "temp";

37 {

38 case ereg("^\\$([_a-zA-z0-9\(\)\'\>\-]*)$", $var, $var): /* ������ ���������� */

39 $replace = "<?PHP echo $" . $var[1] . "; ?>";

40 $tpl_content = str_replace('{' . $var[0] . '}' , $replace, $tpl_content);

41 break;

96 function display()

97 {

98 $temp_file = ROOT.DIRECTORY_SEPARATOR.self::$phpDir.DIRECTORY_SEPARATOR.microtime().self::$phpExt;

99

100 $handle = fopen($temp_file, 'w+');

Report.php (https://github.com/KaRLsM/SIFO.git) PHP · 168 lines

1 <?php

2 /**

3 * This file is part of PHP_PMD.

4 *

5 * PHP Version 5

6 *

7 * Copyright (c) 2009-2011, Manuel Pichler <mapi@phpmd.org>.

37 * POSSIBILITY OF SUCH DAMAGE.

38 *

39 * @category PHP

40 * @package PHP_PMD

41 * @author Manuel Pichler <mapi@phpmd.org>

42 * @copyright 2009-2011 Manuel Pichler. All rights reserved.

43 * @license http://www.opensource.org/licenses/bsd-license.php BSD License

microtime.c (https://gitlab.com/envieidoc/advancedtomato2) C · 166 lines

1 /*

2 +----------------------------------------------------------------------+

3 | PHP Version 5 |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 1997-2014 The PHP Group |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

91 /* {{{ proto mixed microtime([bool get_as_float])

92 Returns either a string or a float containing the current time in seconds and microseconds */

93 PHP_FUNCTION(microtime)

94 {

95 _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);

133 add_assoc_long(return_value, #a, usg.a)

134 #if !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */

135 PHP_RUSAGE_PARA(ru_oublock);

136 PHP_RUSAGE_PARA(ru_inblock);

PortalManager.php (https://gitlab.com/Skull3x/BlockHunt) PHP · 121 lines

1 <?php

2

3 namespace mcg76\game\blockhunt\utils;

112

113 $particle1 = new PortalParticle ($pos1);

114 $random = new Random (( int )(\microtime(\true) * 1000) + \mt_rand());

115 for ($i = 0; $i < $count; ++$i) {

116 $particle1->setComponents($pos1->x + $random->nextSignedFloat() * $xd, $pos1->y + $random->nextSignedFloat() * $yd, $pos1->z + $random->nextSignedFloat() * $zd);

PostImageHandler.php (https://gitlab.com/wubbajack/insided-test) PHP · 288 lines

1 <?php namespace App\Core\Handlers;

2

3 use Intervention\Image\Constraint;

250 }

251

252 return hash('sha1', $prefix . microtime() . $file->getBasename()) . $extension;

253 }

254

Message.php (https://github.com/skoop/Gesichtbuch.git) PHP · 246 lines

1 <?php

2 /**

3 * Zend Framework

18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

19 * @license http://framework.zend.com/license/new-bsd New BSD License

20 * @version $Id: Message.php 6352 2010-08-16 15:02:45Z tpater $

21 */

22

23

24 /**

25 * A message envelope that can be passed to Zend_Wildfire_Plugin_FirePhp to be

26 * logged to Firebug instead of a variable.

27 *

32 * @license http://framework.zend.com/license/new-bsd New BSD License

33 */

34 class Zend_Wildfire_Plugin_FirePhp_Message

35 {

36 /**

microtime.c (https://github.com/filp/php-src.git) C · 166 lines

1 /*

2 +----------------------------------------------------------------------+

3 | PHP Version 5 |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 1997-2011 The PHP Group |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

91 /* {{{ proto mixed microtime([bool get_as_float])

92 Returns either a string or a float containing the current time in seconds and microseconds */

93 PHP_FUNCTION(microtime)

94 {

95 _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);

133 add_assoc_long(return_value, #a, usg.a)

134 #if !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */

135 PHP_RUSAGE_PARA(ru_oublock);

136 PHP_RUSAGE_PARA(ru_inblock);

TLogger.php (https://bitbucket.org/volatileeight/prado.git) PHP · 234 lines

1 <?php

2 /**

3 * TLogger class file

73 } else

74 $ctl = null;

75 $this->_logs[]=array($message,$level,$category,microtime(true),memory_get_usage(),$ctl);

76 }

77

105 * [1] => level

106 * [2] => category

107 * [3] => timestamp (by microtime(), float number));

108 * [4] => memory in bytes

109 * [5] => control client id

01pharSimple.php (https://gitlab.com/Iftekhar_ramim/AtomicProjects_127301_B21) PHP · 112 lines

41 echo date('H:i:s') , " Create new PHPExcel object" , EOL;

42 $objPHPExcel = new PHPExcel();

43

44 // Set document properties

50 ->setDescription("Test document for PHPExcel, generated using PHP classes.")

51 ->setKeywords("office PHPExcel php")

52 ->setCategory("Test result file");

53

79 $callStartTime = microtime(true);

80

81 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

82 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));

94 $callStartTime = microtime(true);

95

96 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');

97 $objWriter->save(str_replace('.php', '.xls', __FILE__));

DatabaseReminderRepository.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 195 lines

1 <?php namespace Illuminate\Auth\Reminders;

2

3 use Carbon\Carbon;

168 $email = $user->getReminderEmail();

169

170 $value = str_shuffle(sha1($email.spl_object_hash($this).microtime(true)));

171

172 return hash_hmac('sha1', $value, $this->hashKey);

Statement.php (https://bitbucket.org/iiic/iszp.git) PHP · 223 lines

1 <?php

2

3 /**

72 }

73

74 $time = microtime(TRUE);

75 try {

76 parent::execute();

79 throw $e;

80 }

81 $this->time = microtime(TRUE) - $time;

82 $this->connection->__call('onQuery', array($this, $params)); // $this->connection->onQuery() in PHP 5.3

93 public function fetchPairs()

94 {

95 return $this->fetchAll(PDO::FETCH_KEY_PAIR); // since PHP 5.2.3

96 }

97

microtime.c (https://bitbucket.org/gnanakeethan/php-src.git) C · 166 lines

1 /*

2 +----------------------------------------------------------------------+

3 | PHP Version 5 |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 1997-2013 The PHP Group |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

91 /* {{{ proto mixed microtime([bool get_as_float])

92 Returns either a string or a float containing the current time in seconds and microseconds */

93 PHP_FUNCTION(microtime)

94 {

95 _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);

133 add_assoc_long(return_value, #a, usg.a)

134 #if !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */

135 PHP_RUSAGE_PARA(ru_oublock);

136 PHP_RUSAGE_PARA(ru_inblock);

QueueTest.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 105 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

8 use Magento\Store\Model\ScopeInterface;

9

10 class QueueTest extends \PHPUnit_Framework_TestCase

11 {

12 /**

13 * @magentoDataFixture Magento/Newsletter/_files/queue.php

14 * @magentoAppIsolation enabled

15 */

58

59 /**

60 * @magentoDataFixture Magento/Newsletter/_files/queue.php

61 * @magentoAppIsolation enabled

62 */

dmCoreFunctionalCoverageTest.php (https://github.com/h16bit/diem.git) PHP · 191 lines

1 <?php

2

3 abstract class dmCoreFunctionalCoverageTest

145 'url' => $url,

146 'mem' => memory_get_usage(),

147 'time' => microtime(true)

148 );

149 }

151 protected function stopCounter()

152 {

153 $time = sprintf('%01.3f', 1000 * (microtime(true) - $this->counter['time']));

154 // $mem = sprintf('%01.3f', (memory_get_usage() - $this->counter['mem'])/1024);

155

func_attachments.php (https://github.com/sidisinsane/TrellisDesk.git) PHP · 260 lines

1 <?php

2

3 /**

99 }

100

101 $file_name = md5( $file['name'] . microtime() );

102 $upload_location = $this->trellis->cache->data['settings']['general']['upload_dir'] . $file_name;

103

Profiler.php (https://bitbucket.org/Jeopardize/wcviewer.git) PHP · 385 lines

1 <?php defined('SYSPATH') OR die('No direct script access.');

2 /**

3 * Provides simple benchmarking and profiling. To display the statistics that

47

48 // Start the benchmark

49 'start_time' => microtime(TRUE),

50 'start_memory' => memory_get_usage(),

51

69 {

70 // Stop the benchmark

71 Profiler::$_marks[$token]['stop_time'] = microtime(TRUE);

72 Profiler::$_marks[$token]['stop_memory'] = memory_get_usage();

73 }

283 {

284 // The benchmark has not been stopped yet

285 $mark['stop_time'] = microtime(TRUE);

286 $mark['stop_memory'] = memory_get_usage();

287 }

Timer.php (https://gitlab.com/judielsm/Handora) PHP · 107 lines

1 <?php

2 /*

3 * This file is part of the PHP_Timer package.

4 *

5 * (c) Sebastian Bergmann <sebastian@phpunit.de>

6 *

7 * For the full copyright and license information, please view the LICENSE

14 * @since Class available since Release 1.0.0

15 */

16 class PHP_Timer

17 {

18 /**

104 PHP_Timer::$requestTime = $_SERVER['REQUEST_TIME'];

105 } else {

106 PHP_Timer::$requestTime = microtime(true);

107 }

108

DatabaseFunctions.php (https://github.com/janislankovskis/OwlSite.git) PHP · 452 lines

1 <?php

2

3

19 $query = getQuery($query);

20 }

21 $time1 = microtime(true);

22

23 $result = mysql_query($query);

28 //{

29

30 $time2 = microtime(true);

31 $cache->executedQueries[sha1($query)] = array(

32 'query' => $query,

376 }

377

378 if($conf['CACHEQUERIES']){ $time1 = microtime(true); }

379

380 $result = mysql_query($query);

build.schema.php (https://github.com/Mark-H/MODX-CMP-Defaults.git) PHP · 139 lines

1 <?php

2 /**

3 * ExtraName

21 *

22 */

23 $mtime = microtime();

24 $mtime = explode(" ", $mtime);

25 $mtime = $mtime[1] + $mtime[0];

27 set_time_limit(0);

28

29 require_once dirname(dirname(__FILE__)) . '/config.core.php';

30 include_once MODX_CORE_PATH . 'model/modx/modx.class.php';

46 $generator= $manager->getGenerator();

47 $generator->classTemplate= <<<EOD

48 <?php

49 /**

50 * ExtraName

Message.php (https://github.com/sitengine/sitengine.git) PHP · 245 lines

1 <?php

2 /**

3 * Zend Framework

22

23 /**

24 * A message envelope that can be passed to Zend_Wildfire_Plugin_FirePhp to be

25 * logged to Firebug instead of a variable.

26 *

31 * @license http://framework.zend.com/license/new-bsd New BSD License

32 */

33 class Zend_Wildfire_Plugin_FirePhp_Message

34 {

35 /**

89 $this->_style = $style;

90 $this->_message = $message;

91 $this->_ruid = md5(microtime().mt_rand());

92 }

93

microtime.c (https://bitbucket.org/luobailiang/php-src.git) C · 166 lines

1 /*

2 +----------------------------------------------------------------------+

3 | PHP Version 5 |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 1997-2012 The PHP Group |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

91 /* {{{ proto mixed microtime([bool get_as_float])

92 Returns either a string or a float containing the current time in seconds and microseconds */

93 PHP_FUNCTION(microtime)

94 {

95 _php_gettimeofday(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);

133 add_assoc_long(return_value, #a, usg.a)

134 #if !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */

135 PHP_RUSAGE_PARA(ru_oublock);

136 PHP_RUSAGE_PARA(ru_inblock);

Logger.php (https://github.com/mbegoc/lighter.git) PHP · 491 lines

1 <?php

2 namespace lighter\handlers;

3

18 * @author Michel Begoc

19 * @copyright (c) 2011 Michel Begoc

20 * @license MIT - see http://www.opensource.org/licenses/mit-license.php

21 *

22 */

221 * @author Michel Begoc

222 * @copyright (c) 2011 Michel Begoc

223 * @license MIT - see http://www.opensource.org/licenses/mit-license.php

224 *

225 */

252 * @author Michel Begoc

253 * @copyright (c) 2011 Michel Begoc

254 * @license MIT - see http://www.opensource.org/licenses/mit-license.php

255 *

256 */

HasOneOrMany.php (https://gitlab.com/pthapa81/MeroSaaman-1.0) PHP · 412 lines

1 <?php namespace Illuminate\Database\Eloquent\Relations;

2

3 use Illuminate\Database\Eloquent\Model;

98 public function getRelationCountHash()

99 {

100 return 'self_'.md5(microtime(true));

101 }

102

Thrift.php (https://gitlab.com/haque.mdmanzurul/nga-loyaltymatters) PHP · 167 lines

1 <?php

2

3 namespace Elastica\Transport;

43 parent::__construct($connection);

44 if (!class_exists('Elasticsearch\\RestClient')) {

45 throw new RuntimeException('Elasticsearch\\RestClient class not found. Check that suggested package munkie/elasticsearch-thrift-php is required in composer.json');

46 }

47 }

144

145 /* @var $result RestResponse */

146 $start = microtime(true);

147

148 $result = $client->execute($restRequest);

149 $response = new Response($result->body);

150

151 $end = microtime(true);

152 } catch (TException $e) {

153 $response = new Response('');

debug_timer.php (https://bitbucket.org/ericsagnes/ezpublish-multisite.git) PHP · 217 lines

1 <?php

2

3 /**

116 $this->runningTimers[$name]->group = $group;

117 $this->runningTimers[$name]->switchTime = array();

118 $this->runningTimers[$name]->startTime = microtime( true );

119 $this->runningTimers[$name]->startNumber = $this->number++;

120

162 $switchStruct = new ezcDebugSwitchTimerStruct();

163 $switchStruct->name = $newName;

164 $switchStruct->time = microtime( true );

165

166 $this->runningTimers[$newName]->switchTime[] = $switchStruct;

190 if ( isset( $this->runningTimers[ $name ] ) )

191 {

192 $this->runningTimers[$name]->stopTime = microtime( true );

193 $this->runningTimers[$name]->elapsedTime = $this->runningTimers[$name]->stopTime - $this->runningTimers[$name]->startTime;

194 $this->runningTimers[$name]->stopNumber = $this->number++;

Gd.php (https://github.com/szeber/yapep.git) PHP · 158 lines

1 <?php

2 /**

3 * This file is part of YAPEP.

7 * @author Zsolt Szeberenyi <szeber@svinformatika.hu>

8 * @copyright 2008 The YAPEP Project All rights reserved.

9 * @license http://www.opensource.org/licenses/bsd-license.php BSD License

10 * @version $Rev: 11068 $

11 */

20 * @author Zsolt Szeberenyi <szeber@svinformatika.hu>

21 * @copyright 2008 The YAPEP Project All rights reserved.

22 * @license http://www.opensource.org/licenses/bsd-license.php BSD License

23 * @version $Rev: 11068 $

24 */

140 $format = 'JPEG';

141 }

142 $tmpFile = $this->config->getPath('uploadTmpDir').md5('gdTmpImage'.microtime(true));

143 $this->pic->saveToFile($tmpFile, $format);

144 $size = null;

doctrine2.yaml.bundlenamespace.php (https://github.com/jupeter/mysql-workbench-schema-exporter.git) PHP · 69 lines

1 <?php

2 /*

3 * The MIT License

28

29 // lets stop the time

30 $start = microtime(true);

31

32

33 // enable autoloading of classes

34 require_once('../lib/MwbExporter/Core/SplClassLoader.php');

35 $classLoader = new SplClassLoader();

36 $classLoader->setIncludePath('../lib');

66

67 // show the time needed to parse the mwb file

68 $end = microtime(true);

69 echo sprintf('%0.3f', $end-$start) . " sec needed";

OOCalcReaderPCLZip.php (https://gitlab.com/Zinnurain/destination_finder_beta) PHP · 64 lines

22 * @package PHPExcel

23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL

25 * @version ##VERSION##, ##DATE##

35

36 // Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file

37 PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

38

39 echo date('H:i:s') , " Load from OOCalc file" , PHP_EOL;

53 echo date('H:i:s') , " Write to Excel2007 format" , PHP_EOL;

54 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

55 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));

56 echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL;

57

58

Section.php (https://github.com/deviantintegral/symfony.git) PHP · 198 lines

1 <?php

2

3 /*

80 {

81 if (null === $session = $this->get($id)) {

82 $session = $this->children[] = new self(microtime(true) * 1000, $this->morePrecision);

83 }

84

119 {

120 if (!isset($this->events[$name])) {

121 $this->events[$name] = new StopwatchEvent($this->origin ?: microtime(true) * 1000, $category, $this->morePrecision);

122 }

123

List.php (https://github.com/rgranadino/magento-mirror.git) PHP · 257 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Catalog

23 * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

180 }

181 }

182 $block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime());

183 return $block;

184 }

smarty_internal_debug.php (https://github.com/taptouchclick/The-Event-Day.git) PHP · 169 lines

1 <?php

2

3 /**

24 {

25 $key = self::get_key($template);

26 self::$template_data[$key]['start_time'] = microtime(true);

27 }

28

33 {

34 $key = self::get_key($template);

35 self::$template_data[$key]['compile_time'] += microtime(true) - self::$template_data[$key]['start_time'];

36 }

37

42 {

43 $key = self::get_key($template);

44 self::$template_data[$key]['start_time'] = microtime(true);

45 }

46

namespace_registry.php (https://github.com/F5/zetacomponents.git) PHP · 190 lines

1 <?php

2 /**

3 * File containing the ezcWebdavNamespaceRegistry class.

173 * Produces a new shortcut for a namespace by using {@link

174 * $this->shortcutBase} and the first 5 characters of the MD5 hash of the

175 * current microtime. Only returns unused shortcuts.

176 *

177 * @return string

finder_indexer.php (https://github.com/gnomeontherun/joomla-cms.git) PHP · 196 lines

1 <?php

2 /**

3 * @package Joomla.Cli

17

18 // Load system defines

19 if (file_exists(dirname(__DIR__) . '/defines.php'))

20 {

21 require_once dirname(__DIR__) . '/defines.php';

25 {

26 define('JPATH_BASE', dirname(__DIR__));

27 require_once JPATH_BASE . '/includes/defines.php';

28 }

29

30 // Get the framework.

31 require_once JPATH_LIBRARIES . '/import.legacy.php';

32

33 // Bootstrap the CMS libraries.

ezpagezone.php (https://github.com/quochuy/ezflow.git) PHP · 393 lines

1 <?php

2 //

3 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##

381 public function __clone()

382 {

383 $this->attributes['id'] = md5( (string)microtime() . (string)mt_rand() );

384 $this->attributes['action'] = 'add';

385

List.php (https://bitbucket.org/spenna/alexoo_produzione.git) PHP · 257 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Catalog

23 * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

180 }

181 }

182 $block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime());

183 return $block;

184 }

StreamSelectLoop.php (https://bitbucket.org/nbravo777/repo_ratchet.git) PHP · 170 lines

1 <?php

2

3 namespace React\EventLoop;

90 }

91

92 $currentTime = microtime(true);

93 if ($nextEvent > $currentTime) {

94 return ($nextEvent - $currentTime) * 1000000;

105 // We use usleep() instead of stream_select() to emulate timeouts

106 // since the latter fails when there are no streams registered for

107 // read / write events. Blame PHP for us needing this hack.

108 usleep($this->getNextEventTimeInMicroSeconds());

109 }

Search.php (https://github.com/spidaboy7/kumva.git) PHP · 191 lines

1 <?php

2 /**

3 * This file is part of Kumva.

69 */

70 public function run($source = NULL) {

71 $start = microtime(TRUE);

72

73 $initSearchType = $this->query->isPartialMatch() ? SearchType::FORM : SearchType::STEM;

108 }

109

110 $this->time = (int)((microtime(true) - $start) * 1000);

111

112 // Only log the search if its not a robot or an authenticated user

Sample.php (https://gitlab.com/mbase2/source-code) PHP · 230 lines

1 <?php

2

3 namespace PhpOffice\PhpSpreadsheet\Helper;

4

5 use PhpOffice\PhpSpreadsheet\IOFactory;

6 use PhpOffice\PhpSpreadsheet\Spreadsheet;

7 use PhpOffice\PhpSpreadsheet\Writer\IWriter;

8 use PhpOffice\PhpSpreadsheet\Writer\Pdf;

9 use RecursiveDirectoryIterator;

10 use RecursiveIteratorIterator;

55 public function getPageTitle()

56 {

57 return $this->isIndex() ? 'PHPSpreadsheet' : $this->getScriptFilename();

58 }

59

CLogRoute.php (https://github.com/joshuaswarren/weatherhub.git) PHP · 115 lines

1 <?php

2 /**

3 * CLogRoute class file.

26 *

27 * @author Qiang Xue <qiang.xue@gmail.com>

28 * @version $Id: CLogRoute.php 3205 2011-05-07 23:16:46Z qiang.xue $

29 * @package system.logging

30 * @since 1.0

110 * [1] => level (string)

111 * [2] => category (string)

112 * [3] => timestamp (float, obtained by microtime(true));

113 */

114 abstract protected function processLogs($logs);

ApiCallMonitoringMiddleware.php (https://github.com/trob/fabrik.git) PHP · 176 lines

1 <?php

2

3 namespace Aws\ClientSideMonitoring;

171 ) {

172 $event = parent::populateResultEventData($result, $event);

173 $event['Latency'] = (int) (floor(microtime(true) * 1000) - $event['Timestamp']);

174 return $event;

175 }

Products.php (https://github.com/r1zib/salesforce.git) PHP · 157 lines

1 <?php

2

3 class Application_Model_Products

95 $sales = Application_Model_SalesforceConnect::getInstance();

96 $vue = array();

97 $time_start = $sales->microtime_float();

98

99 $vue['products'] = $sales->query('Product2', $lstCol, $where);

103 echo $vue['products'];

104 }

105 $time_end = $sales->microtime_float();

106

107 $vue['cols'] = explode(',', $lstCol);

database-status.php (https://gitlab.com/VTTE/sitios-vtte) PHP · 371 lines

1 <?php

2

3 class Red_Database_Status {

266 'current' => $this->get_current_version() ? $this->get_current_version() : '-',

267 'next' => REDIRECTION_DB_VERSION,

268 'time' => microtime( true ),

269 ];

270 }

365

366 private function clear_cache() {

367 if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) && function_exists( 'wp_cache_flush' ) ) {

368 wp_cache_flush();

369 }

profiler.php (https://bitbucket.org/alvinpd/monsterninja.git) PHP · 377 lines

1 <?php defined('SYSPATH') or die('No direct script access.');

2 /**

3 * Provides simple benchmarking and profiling. To display the statistics that

10 * @author Kohana Team

11 * @copyright (c) 2009-2010 Kohana Team

12 * @license http://kohanaphp.com/license

13 */

14 class Kohana_Profiler {

45

46 // Start the benchmark

47 'start_time' => microtime(TRUE),

48 'start_memory' => memory_get_usage(),

49

67 {

68 // Stop the benchmark

69 Profiler::$_marks[$token]['stop_time'] = microtime(TRUE);

70 Profiler::$_marks[$token]['stop_memory'] = memory_get_usage();

71 }

Entry.php (https://github.com/snyderp/AIS_IMAP.git) PHP · 343 lines

1 <?php

2 /**

3 * This package contains a series of files that wraps around the functionality

4 * provided by the PHP IMAP extension, and provide an OO interface for interacting

5 * with IMAP mail servers, their messages, and those messages' attachments.

6 *

222 *

223 * @return string

224 * @see http://php.net/manual/en/function.microtime.php

225 */

226 public function time()

307 * @return AIS_Debugger_Entry a refernece to the current object, to all

308 * for method chaining

309 * @see http://php.net/manual/en/function.debug-backtrace.php

310 */

311 public function populateWithBacktrace($backtrace)

User.php (https://gitlab.com/gothcon/cthulhu) PHP · 496 lines

1 <?php

2

3 namespace Entities;

472

473 static public function generateRandomString($length = 12 ,$allchar = "abcdefghijkmnoprstuzABCDFKLMRSTUVWX1235690#!?"){

474 mt_srand ((double) microtime() * 1000000);

475 $allCharCount=strlen($allchar);

476 $string = "";

DaemonHttpRunner.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 162 lines

1 <?php

2

3 namespace MailPoet\Cron;

39 $this->settingsDaemonData = $this->cronHelper->getDaemon();

40 $this->token = $this->cronHelper->createToken();

41 $this->timer = microtime(true);

42 $this->daemon = $daemon;

43 $this->settings = $settings;

95 // if workers took less time to execute than the daemon execution limit,

96 // pause daemon execution to ensure that daemon runs only once every X seconds

97 $elapsedTime = microtime(true) - $this->timer;

98 if ($elapsedTime < $this->cronHelper->getDaemonExecutionLimit()) {

99 $this->pauseExecution($this->cronHelper->getDaemonExecutionLimit() - $elapsedTime);