Created
July 24, 2012 12:51
-
-
Save krismas/3169775 to your computer and use it in GitHub Desktop.
A small MODX snippet to time other snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* A small MODX snippet to time other snippets - (c) 2012 ackwa.fr | |
* | |
* @see : https://gist.github.com/gists/3169775 | |
* @name : now.php | |
* @author : g.noel@ackwa.fr | |
* @usage : [[!now]] -> First call | |
* [[!now?seed=`1`]] -> subsequent calls | |
* | |
* @history : 24/06/12 - 1.0.0 - Initial revision | |
*/ | |
$fNow = microtime(true); | |
$sSeed = ((isset($seed) && $seed ) ? $seed : 0); | |
$fPrev = &$_SESSION['acknow']; | |
$fDelay = ($sSeed ? ($fNow - $fPrev) : ''); | |
$fPrev = $fNow; | |
return $fDelay; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment