PHP microtime

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : microtime() function

Description

The microtime() function creates current Unix timestamp with microseconds values.

Version

(PHP 4 and above)

Syntax

microtime(get_as_float) 

Parameter

Name

Description

Required /
Optional

Type

get_as_float

When it set to true then a float (in seconds) is returned instead of a string.

Optional

Boolean

 

Return value

Unix timestamp

Value Type : Mixed*.

*Mixed : Mixed indicates multiple (but not necessarily all) types.

Example :

  1. echo(microtime());  

  2. ?>  

Output :

0.01583100 1295421766

Note : Since the current time is not static, therefore the output may vary