"PHP 수행시간 측정"의 두 판 사이의 차이

7번째 줄: 7번째 줄:
<?php
<?php
function get_time() {
function get_time() {
$a = explode(' ', microtime());
    list($usec, $sec) = explode(" ", microtime());
return (double)$a[0]+$a[1];
    return ((float)$usec + (float)$sec);
}
}



2012년 2월 26일 (일) 21:34 판

  • PHP 수행시간 측정
  • PHP 속도 측정
  • PHP 속도 비교

1 수행시간 측정

<?php
function get_time() {
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}

$start = get_time();
/*
수행할 내용
*/
$end = get_time();
echo '<br/>'.number_format($end - $start, 2). "초 걸림";
?>

2 참고자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}