timer_float() WordPress Function

The timer_float() WordPress function is used to display the time since a given date in floating point format. The function takes two arguments: the date to calculate the time since, and an optional format string. The default format string is "%.2f" which will display the time since the given date in hours, minutes, and seconds.

timer_float() #

Get the time elapsed so far during this PHP script.


Description

Uses REQUEST_TIME_FLOAT that appeared in PHP 5.4.0.


Top ↑

Return

(float) Seconds since the PHP script started.


Top ↑

Source

File: wp-includes/load.php

function timer_float() {
	return microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT'];
}

Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.