[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Measuring the time taken by the CGI...


Fred,

I'd like to measure the time taken to execute each particular hit to cgi::app and display the result.

My thoughts on how to implement this are roughly:

* get the time $T1 in cgiprerun - store in $self
* get the time $T2 in cgipostrun and compute the difference
* output the result as a template param. (is my output out already?)

Anyone done this or something like it already?  Thoughts?

1) use Time::HiRes. It gives you milliseconds. You want that.

2) if you do not want to change your templates to output the time, you can just "print" your timing message after the output has been sent,
	for example in teardown().
(in cgipostrun the output has not been sent yet, but it will most likely have been flatted into a string by $tmpl->output(), so you will have trouble
	putting in more parameters... )

Thilo


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.