Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2007-07-30 21:37:46 +0400
committermatthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2007-07-30 21:37:46 +0400
commit906e61aafe9ff1ff73b16c3738dd00d6d8bfbdd2 (patch)
tree1e1929fa7c09dee753344cb61245c4f964e763e1 /modules/Timer.php
parent2157033b8b6a5aeeecad81dd0b094cbfd76a523b (diff)
- logging system DONE
- fixed bug Access - input filtering functions
Diffstat (limited to 'modules/Timer.php')
-rw-r--r--modules/Timer.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/Timer.php b/modules/Timer.php
new file mode 100644
index 0000000000..5854313516
--- /dev/null
+++ b/modules/Timer.php
@@ -0,0 +1,32 @@
+<?php
+class Piwik_Timer
+{
+ private $m_Start;
+
+ public function __construct()
+ {
+ $this->m_Start = 0.0;
+ $this->init();
+ }
+
+ private function getMicrotime()
+ {
+ list($micro_seconds, $seconds) = explode(" ", microtime());
+ return ((float)$micro_seconds + (float)$seconds);
+ }
+
+ public function init()
+ {
+ $this->m_Start = $this->getMicrotime();
+ }
+
+ public function getTime($decimals = 2)
+ {
+ return number_format($this->getMicrotime() - $this->m_Start, $decimals, '.', '');
+ }
+ public function getTimeMs($decimals = 2)
+ {
+ return number_format(1000*($this->getMicrotime() - $this->m_Start), $decimals, '.', '');
+ }
+}
+?> \ No newline at end of file