|
|
|
You can always see the "Loading time:..." in many web sites. Well this is a simple way on how to do it:
| <?php
// Get Current Time
$mtime = microtime();
// Split Seconds and Microseconds
$mtime = explode (" ", $mtime);
// Create a single value for start time
$mtime = $mtime[1] + $mtime[0];
// Write Start Time Into A Variable
$tstart = $mtime;
// Get current time (Like above) to get end time
$mtime = microtime();
$mtime = explode (" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
// Store end time in a variable
$tend = $mtime;
// Calculate Difference
$totaltime = ($tend - $tstart);
// Output the result
printf ("This page was generated in %f seconds.", $totaltime);
?> | | |
|
| Kewl Date Example Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides | | | Local Time clock and Server time usign PHP and JavaScript Categories : PHP, Java Script, Date Time, Beginner Guides | | | Find the day of the week for any given year/month/day. Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides | | | Change the background color of a website daily dynamically using the php date function to get the current day of the week and depending on that day, set the background color for the web page. Categories : PHP, Date Time, Beginner Guides, Web Design | | | Find if a year is leap. Categories : PHP, Date Time, Beginner Guides, Data Validation | | | How to Insert a Date Format Into MySQL from PHP Categories : PHP, Databases, MySQL, Date Time, Beginner Guides | | | Basic Authentication with sessions Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions | | | Introduction to Language Files Categories : PHP, Filesystem, Beginner Guides | | | News management class Categories : PHP, PHP Classes, Beginner Guides | | | A Timing Class Categories : PHP, PHP Classes, Date Time | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | Finding the day of the week for a specific date.
Categories : PHP, Databases, MySQL, Date Time | | | Different Call User Functions Categories : PHP, Functions, Beginner Guides | | | A wrapper function to format dates coming from a databases with the
same syntax as PHP's date() function. Categories : Date Time, Databases, PHP | | | pcCalendar class - Allows for the creation of calendars in HTML pages. All output functions can be easily overridden, refer to article 1471 for an example.
Categories : PHP, Date Time, Calendar, PHP Classes | |
|
|
|