File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -83,5 +83,36 @@ public function testThrowsExceptionStoppingNonTimer()
8383
8484 //--------------------------------------------------------------------
8585
86+ public function testLongExecutionTime ()
87+ {
88+ $ timer = new Timer ();
8689
90+ $ timer ->start ('longjohn ' , strtotime ('-11 minutes ' ));
91+
92+ // Use floor here to account for fractional differences in seconds.
93+ $ this ->assertEquals (11 * 60 , floor ($ timer ->getElapsedTime ('longjohn ' )));
94+ }
95+
96+ //--------------------------------------------------------------------
97+
98+ public function testLongExecutionTimeThroughCommonFunc ()
99+ {
100+ timer ()->start ('longjohn ' , strtotime ('-11 minutes ' ));
101+
102+ // Use floor here to account for fractional differences in seconds.
103+ $ this ->assertEquals (11 * 60 , floor (timer ()->getElapsedTime ('longjohn ' )));
104+ }
105+
106+ //--------------------------------------------------------------------
107+
108+ public function testCommonStartStop ()
109+ {
110+ timer ('test1 ' );
111+ sleep (1 );
112+ timer ('test1 ' );
113+
114+ $ this ->assertGreaterThanOrEqual (1.0 , timer ()->getElapsedTime ('test1 ' ));
115+ }
116+
117+ //--------------------------------------------------------------------
87118}
You can’t perform that action at this time.
0 commit comments