Index: trunk/kernel/include/debugger.php
===================================================================
diff -u -r842 -r854
--- trunk/kernel/include/debugger.php (.../debugger.php) (revision 842)
+++ trunk/kernel/include/debugger.php (.../debugger.php) (revision 854)
@@ -69,7 +69,8 @@
case 'profiler':
$profileKey = $Data['profile_key'];
$Data =& $this->ProfilerData[$profileKey];
- return 'Name: '.$Data['description'].'. Runtime: '.($Data['ends'] - $Data['begins']);
+ $runtime = ($Data['ends'] - $Data['begins']); // in seconds
+ return 'Name: '.$Data['description'].'. Runtime: '.$runtime.'s';
break;
default:
@@ -103,15 +104,39 @@
function profileStart($key, $description)
{
- $this->ProfilerData[$key] = Array('begins' => time(), 'debuggerRowID' => count($this->Data), 'description' => $description);
+ $timeStamp = $this->getMoment();
+ $this->ProfilerData[$key] = Array('begins' => $timeStamp, 'ends' => 5000, 'debuggerRowID' => count($this->Data), 'description' => $description);
$this->Data[] = array('profile_key' => $key, 'debug_type' => 'profiler');
}
function profileFinish($key)
{
- $this->ProfilerData[$key]['ends'] = time();
+ $this->ProfilerData[$key]['ends'] = $this->getMoment();
}
+ function getMoment()
+ {
+ list($usec, $sec) = explode(' ', microtime());
+ return ((float)$usec + (float)$sec);
+ }
+
+ function generateID()
+ {
+ list($usec, $sec) = explode(" ",microtime());
+
+ $id_part_1 = substr($usec, 4, 4);
+ $id_part_2 = mt_rand(1,9);
+ $id_part_3 = substr($sec, 6, 4);
+ $digit_one = substr($id_part_1, 0, 1);
+ if ($digit_one == 0) {
+ $digit_one = mt_rand(1,9);
+ $id_part_1 = ereg_replace("^0","",$id_part_1);
+ $id_part_1=$digit_one.$id_part_1;
+ }
+ return $id_part_1.$id_part_2.$id_part_3;
+ }
+
+
function getErrorNameByCode($errorCode)
{
switch($errorCode)