File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/Symfony/Component/Stopwatch Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ class Stopwatch
38
38
*/
39
39
public function __construct ($ morePrecision = false )
40
40
{
41
- $ this ->reset ();
42
41
$ this ->morePrecision = $ morePrecision ;
42
+ $ this ->reset ();
43
43
}
44
44
45
45
/**
Original file line number Diff line number Diff line change @@ -100,6 +100,18 @@ public function testStopWithoutStart()
100
100
$ stopwatch ->stop ('foo ' );
101
101
}
102
102
103
+ public function testMorePrecision ()
104
+ {
105
+ $ stopwatch = new Stopwatch (true );
106
+
107
+ $ stopwatch ->start ('foo ' );
108
+ $ event = $ stopwatch ->stop ('foo ' );
109
+
110
+ $ this ->assertInternalType ('float ' , $ event ->getStartTime ());
111
+ $ this ->assertInternalType ('float ' , $ event ->getEndTime ());
112
+ $ this ->assertInternalType ('float ' , $ event ->getDuration ());
113
+ }
114
+
103
115
public function testSection ()
104
116
{
105
117
$ stopwatch = new Stopwatch ();
You can’t perform that action at this time.
0 commit comments