Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $time_marker = 0;
- function mark_timer(){
- $time = microtime();
- $time = explode(' ', $time);
- $time = (float)$time[1] + (float)$time[0];
- $_SESSION["time_marker"] = $time;
- }
- function end_and_print_timer($caption = ""){
- $time = microtime();
- $time = explode(' ', $time);
- $time = (float)$time[1] + (float)$time[0];
- $finish = $time;
- $total_time = round(($finish - $_SESSION["time_marker"]), 4);
- if(!empty($caption)){
- echo "<br/>$caption";
- }
- echo $total_time . "secs";
- }
- function reset_timer(){
- $_SESSION["time_marker"] = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement