Permalink
Browse files

set default timezone, correct sub-second sleeps

  • Loading branch information...
1 parent 8a5646c commit b66d2ce0d0f3d85d56ac64e7d35d0b9c85271c90 @trevyn trevyn committed Jan 11, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 demo/demo.php
View
@@ -1,5 +1,7 @@
<?
+date_default_timezone_set("UTC");
+
require "../profiler.php";
Profiler::enable();
@@ -10,19 +12,19 @@
$s1 = Profiler::start('Step 1');
//do some important things!
-sleep(.5);
+usleep(500000); // 0.5 sec
$s1->end();
$s2 = Profiler::start('Step 2');
//more important things
-sleep(.1);
+usleep(100000); // 0.1 sec
$s3 = Profiler::start('Step 3');
//some nested things..that are important and stuff.
sleep(1);
$sql = Profiler::sqlStart("SELECT * FROM TABLE WHERE 1");
- sleep(1.5);
+ usleep(1500000); // 1.5 sec
$sql->end();
$s3->end();

0 comments on commit b66d2ce

Please sign in to comment.