cloudll Posted June 2, 2015 Share Posted June 2, 2015 I am using this code to track how long my script has taken to load. $loadTime = (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']); I was wondering if there was a way to convert the loadTime into a more readable format, as it stands it outputs something like this: 0.038604021072388 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/296608-converting-microtime/ Share on other sites More sharing options...
Solution Ch0cu3r Posted June 2, 2015 Solution Share Posted June 2, 2015 Use number_format echo number_format($loadtime, 2); // output loadtime to 2 decimal places 1 Quote Link to comment https://forums.phpfreaks.com/topic/296608-converting-microtime/#findComment-1513054 Share on other sites More sharing options...
cloudll Posted June 2, 2015 Author Share Posted June 2, 2015 Awesome, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/296608-converting-microtime/#findComment-1513058 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.