Skip to content

Commit b091920

Browse files
committed
Remove unused microtime_diff function. Fixes elementor#880
1 parent 10131ca commit b091920

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

src/CLI.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,6 @@ public function diagnostics() : void {
8686

8787
}
8888

89-
public function microtime_diff(
90-
string $start,
91-
string $end = null
92-
) : float {
93-
if ( ! $end ) {
94-
$end = microtime();
95-
}
96-
97-
list( $start_usec, $start_sec ) = explode( ' ', $start );
98-
list( $end_usec, $end_sec ) = explode( ' ', $end );
99-
100-
$diff_sec = intval( $end_sec ) - intval( $start_sec );
101-
$diff_usec = floatval( $end_usec ) - floatval( $start_usec );
102-
103-
return floatval( $diff_sec ) + $diff_usec;
104-
}
105-
106-
10789
/**
10890
* Get info on plugin status.
10991
*

src/Utils.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,7 @@
22

33
namespace WP2Static;
44

5-
use Exception;
6-
75
class Utils {
8-
/*
9-
* Takes either an http or https URL and returns a // protocol-relative URL
10-
*
11-
* @param string $start timer start
12-
* @param string $end timer end
13-
* @return float time between start and finish
14-
*/
15-
public static function microtime_diff(
16-
string $start,
17-
string $end = null
18-
) : float {
19-
if ( ! $end ) {
20-
$end = microtime();
21-
}
22-
23-
list( $start_usec, $start_sec ) = explode( ' ', $start );
24-
list( $end_usec, $end_sec ) = explode( ' ', $end );
25-
26-
$diff_sec = intval( $end_sec ) - intval( $start_sec );
27-
$diff_usec = floatval( $end_usec ) - floatval( $start_usec );
28-
29-
return floatval( $diff_sec ) + $diff_usec;
30-
}
31-
326
/*
337
* Adjusts the max_execution_time ini option
348
*

0 commit comments

Comments
 (0)