Your Daily Source for Apache News and Information  
Breaking News Preferences Contribute Triggers Link Us Search About
Apache Today [Your Apache News Source] To internet.com

Apache HTTPD Links
Apache-Perl Integration Project
The Apache FAQ
Apache Module Registry
Apache Project
The Apache Software Foundation
The Jakarta Project
Apache XML Project
PHP Server Side Scripting
The Java Apache Project
ApacheCon
Apache-Related Projects

  internet.com

Internet News
Internet Investing
Internet Technology
Windows Internet Tech.
Linux/Open Source
Web Developer
ECommerce/Marketing
ISP Resources
ASP Resources
Wireless Internet
Downloads
Internet Resources
Internet Lists
International
EarthWeb
Career Resources

Search internet.com
Advertising Info
Corporate Info
PHPBuilder: Timing Script Execution
Oct 1, 2000, 19 :05 UTC (0 Talkback[s]) (692 reads) (Other stories by Allan Kent)

"No doubt you've all seen on Google's search page where it tells you how long your search took to complete. This, and some talk I noticed a while back in one of the forums about some of the scripts that were taking a while to execute made me think about how you would go about timing your scripts."

"The easiest way of timing a script would be to get the time at the beginning of the script and then get the time at the end of the script. The difference between the two is the time it took your script to run. PHP has a function time() which returns the number of seconds since 1970. Now I can't speak for everyone here, but typically the scripts that I write tend to finish running within a second. So measuring the time in seconds is not really going to help me. A topical example would be using something like an egg timer to time the 100m Olympic final - unless someone breaks both their legs on the starting blocks, all the runners will be within 1 egg timer. The microtime() function gives us what we need - the fractional part of the second at the time that the function was called. It also gives us the number of seconds since 1970 like time() does, so we don't need to call both functions. The only problem with the microtime() function is that it returns to us a string with 2 numbers in it - the seconds part, and the fractional part - separated by a space."

Complete Story

Related Stories:
Why and How I Installed PHP4, MySQL, and Apache on Windows 98(Sep 27, 2000)
ZDNet: Opening a Few Windows with PHP(Sep 18, 2000)
PHP Security Advisory - File Uploads(Sep 11, 2000)
PHPBuilder: File Uploads Made Easy(Sep 05, 2000)
LinuxPorts: PHP -- A Cookie Experiment(Sep 01, 2000)
PHPBuilder: Graphing With PHP and GD(Sep 01, 2000)
PHPBuilder: How to Document Your PHP Classes(Aug 28, 2000)

  Current Newswire:
WDVL: Perl for Web Site Management: Part 3

Retro web application framework V1.1.0 release

Leveraging open standards such as Java, JSP, XML,J2EE, Expresso and Struts.

Netcraft Web Server Survey for November is available

FoxServ 2.0 Released

Ace's Hardware: Building a Better Webserver in the 21st Century

Web Techniques: Customer Number One

Apache-Frontpage RPM project updated

CNet: Open-source approach fades in tough times

NewsForge: VA spin-off releases first product, aims for profit


No talkbacks posted.
Enter your comments below.
Your Name: Your Email Address:


Subject: CC: [will also send this talkback to an E-Mail address]
Comments:

See our talkback-policy for or guidelines on talkback content.

About Triggers Media Kit Security Triggers Login


All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux 2.4, Apache 1.3, and PHP 4
Copyright INT Media Group, Incorporated All Rights Reserved.
Legal Notices,  Licensing, Reprints, & Permissions,  Privacy Policy.
http://www.internet.com/