![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 65 Pomógł: 2 Dołączył: 25.08.2003 Skąd: Lublin Ostrzeżenie: (0%) ![]() ![]() |
no ja bym to tak rozwiazal
[php:1:309bbda4e9]<?php function timer() { $unix=date("U"); $micro=microtime(); return $unix+$micro; } // POCZATEK SKRYPTU $start=timer(); // KONIEC SKRYPTU $end=$timer(); // WYNIKI print $end-$start; ?>[/php:1:309bbda4e9] a jak wy to byscie rozwiazali..... -------------------- textmate @mac trance / buraki |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Przyjaciele php.pl Postów: 2 335 Pomógł: 6 Dołączył: 7.03.2002 Ostrzeżenie: (0%) ![]() ![]() |
Np. tak:
[php:1:9d3ffffca4]class Timer { var $_startTimer = 0, $result = 0; function _GetTimer() { list( $uSec, $sec ) = explode( ' ', microtime() ); return (float)$uSec + (float)$sec; } function Start() { ob_start(); $this->_startTimer = $this->_GetTimer(); } function Stop() { $this->result = $this->_GetTimer() - $this->_startTimer; ob_end_flush(); } } $timer = new Timer(); $timer->Start(); sleep(3); // przerwa na kawe ![]() $timer->Stop(); print $timer->result;[/php:1:9d3ffffca4] |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 25.06.2025 - 17:00 |