PluginProbe
WP Synchro – The Ultimate WordPress Migration Tool / trunk
WP Synchro – The Ultimate WordPress Migration Tool vtrunk
1.16.1 1.16.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.10.0 1.11.0 1.11.1 1.11.2 1.11.3 1.11.4 1.11.5 1.12.0 1.13.0 1.14.0 1.15.0 1.2.0 1.3.0 1.3.1 1.3.2 All 45 releases
wpsynchro / src / Utilities / SyncTimer.php

SyncTimer.php in WP Synchro – The Ultimate WordPress Migration Tool trunk, at src/Utilities/SyncTimer.php

47 lines 813 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPSynchro\Utilities;
4
5 /**
6 * Class to represent a single timer
7 *
8 */
9 class SyncTimer
10 {
11 public $desc = null;
12 public $time_start = null;
13 public $time_end = null;
14 public $elapsed = 0;
15
16 public function __construct()
17 {
18 }
19
20 public function setStart($time_as_float)
21 {
22 $this->time_start = $time_as_float;
23 }
24
25 public function startNow()
26 {
27 $this->time_start = microtime(true);
28 }
29
30 public function endNow()
31 {
32 $this->time_end = microtime(true);
33 $this->elapsed = $this->time_end - $this->time_start;
34 return $this->elapsed;
35 }
36
37 public function getTimeUntilNow()
38 {
39 return microtime(true) - $this->time_start;
40 }
41
42 public function getElapsed()
43 {
44 return $this->elapsed;
45 }
46 }
47