473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Time for page

Hi!

Is there a timer for the page, so I can see how long it has taken for
process the page?
Say, the page opens,and at the buttom there is a text say "it took 4
hrs to process your request" :-)

BR
Sonnich

Aug 31 '07 #1
4 1254
On 31 Aug., 09:04, Sonnich Jensen <sonnich.jen...@jotautomation.com>
wrote:
Hi!

Is there a timer for the page, so I can see how long it has taken for
process the page?
Say, the page opens,and at the buttom there is a text say "it took 4
hrs to process your request" :-)

BR
Sonnich
begin of page
<?PHP
$t1=time();
....end of page...
$t2=time();
$duration=$t2-t1;
echo "it took $duration millisecs";
?>

Aug 31 '07 #2
al*******@modelagentur.de wrote:
On 31 Aug., 09:04, Sonnich Jensen <sonnich.jen...@jotautomation.com>
wrote:
>Hi!

Is there a timer for the page, so I can see how long it has taken for
process the page?
Say, the page opens,and at the buttom there is a text say "it took 4
hrs to process your request" :-)

BR
Sonnich

begin of page
<?PHP
$t1=time();
...end of page...
$t2=time();
$duration=$t2-t1;
echo "it took $duration millisecs";
?>
(Small correction)
Alexander is right, but the samplecode is producing SECONDS, not millis.

time — Return current Unix timestamp
Description
int time ( void )
Returns the current time measured in the number of seconds since the
Unix Epoch (January 1 1970 00:00:00 GMT).

If you want millis, use microtime:

microtime — Return current Unix timestamp with microseconds

Regards,
Erwin Moller
Aug 31 '07 #3
On Aug 31, 12:07 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
alexan...@modelagentur.de wrote:
On 31 Aug., 09:04, Sonnich Jensen <sonnich.jen...@jotautomation.com>
wrote:
Hi!
Is there a timer for the page, so I can see how long it has taken for
process the page?
Say, the page opens,and at the buttom there is a text say "it took 4
hrs to process your request" :-)
BR
Sonnich
begin of page
<?PHP
$t1=time();
...end of page...
$t2=time();
$duration=$t2-t1;
echo "it took $duration millisecs";
?>

(Small correction)
Alexander is right, but the samplecode is producing SECONDS, not millis.

time - Return current Unix timestamp
Description
int time ( void )
Returns the current time measured in the number of seconds since the
Unix Epoch (January 1 1970 00:00:00 GMT).

If you want millis, use microtime:

microtime - Return current Unix timestamp with microseconds

Regards,
Erwin Moller- Hide quoted text -
Thanks to both of you. I use the trick as suggested here, I was just
wondering whether there is another solution.

Have a nice weekend
Sonnich

Aug 31 '07 #4
Sonnich Jensen wrote:
On Aug 31, 12:07 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
>alexan...@modelagentur.de wrote:
>>On 31 Aug., 09:04, Sonnich Jensen <sonnich.jen...@jotautomation.com>
wrote:
Hi!
Is there a timer for the page, so I can see how long it has taken for
process the page?
Say, the page opens,and at the buttom there is a text say "it took 4
hrs to process your request" :-)
BR
Sonnich
begin of page
<?PHP
$t1=time();
...end of page...
$t2=time();
$duration=$t2-t1;
echo "it took $duration millisecs";
?>
(Small correction)
Alexander is right, but the samplecode is producing SECONDS, not millis.

time - Return current Unix timestamp
Description
int time ( void )
Returns the current time measured in the number of seconds since the
Unix Epoch (January 1 1970 00:00:00 GMT).

If you want millis, use microtime:

microtime - Return current Unix timestamp with microseconds

Regards,
Erwin Moller- Hide quoted text -

Thanks to both of you. I use the trick as suggested here, I was just
wondering whether there is another solution.
Hi Sonnich,

Yes, there are other solutions.
Like a profiler/debugger solution.
I think it is build in in Zend Framework/Platform.
If you need this kind of information on a regular basis, you might have
a look at it. (Free trial at www.zend.com)

But be prepared: You'll have to install it, open ports on the server for
debugging/profiling, etc.
It is not just some program that automagically produces this information.
But maybe it is easy, I never used it actually. ;-)
(I use Basic Zend Development Environment, the simple version)

Regards,
Erwin Moller

>
Have a nice weekend
Sonnich
Aug 31 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Yang Li Ke | last post by:
Hi guys, Im about to build a script which will log visitor time spent on my website. I got a few ideas about this, maybe checking visitors ip and storing that info in db with time in and then...
5
by: Gord | last post by:
Many scripts and calendars call client side system time in order to make presentations. However, the client's time may be improperly set, if set at all, and/or the relevant time may be from...
11
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
5
by: RICHARD BROMBERG | last post by:
I am writing an ASP program that includes a Form. When the Form is submitted I use the Date() and Time() functions to put the date and time into the Body part of the e-mail. The time reported is...
5
by: Manish Jain | last post by:
Environment: Windows 2000 Server (SP4), ASP.Net/C# (Framework 1.1) Hardware: PIII @ 700 MHz, 512 MB RAM ----------------------------------------------------------------------------...
9
by: Adrian Dragomirescu | last post by:
Hello, I have the following problem: In my ASPX page is a button called "Import". The action of this button is to import a set of data in my database. I have to import big datasets and this...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
2
by: Roseanne | last post by:
We are experiencing very slow response time in our web app. We run IIS 6 - windows 2003. I ran iisstate. Here's what I got. Any ideas?? Opened log file 'F:\iisstate\output\IISState-812.log'...
2
by: Teenzonez | last post by:
Hi I am doing a simple application using ajax which wil fetch time from server to a javascript function. i have one html file and one asp page. In the html page i have two text boxes by name...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.