From 3a99b1626b3d9ce66da88856d9821caef5cb9864 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 24 Apr 2005 22:33:54 +0000 Subject: [PATCH] Added fetch_microtime_diff() function --- functions.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/functions.php b/functions.php index da0b7fa..9ab65b0 100644 --- a/functions.php +++ b/functions.php @@ -394,6 +394,21 @@ class Functions } return current($array); } + + /** + * Calculates the microtime difference by taking a given microtime and subtracting it from the current one + * + * @param str The start microtime + * + * @return float Microtime difference + */ + function fetch_microtime_diff($mtstart) + { + $mtend = microtime(); + list ($starttime['micro'], $starttime['sec']) = explode(' ', $mtstart); + list ($endtime['micro'], $endtime['sec']) = explode(' ', $mtend); + return ($endtime['micro'] + $endtime['sec']) - ($starttime['micro'] + $starttime['sec']); + } } /*=====================================================================*\ -- 2.43.5