|
Time\Duration::fromNanosecondsCreates a duration from a number of nanoseconds Description
public static Time\Duration Time\Duration::fromNanoseconds(int
$nanoseconds)
Creates a non-negative duration of Parameters
Return ValuesReturns a new Time\Duration object. Errors/Exceptions
ExamplesExample #1 Time\Duration::fromNanoseconds example The above example will output:
object(Time\Duration)#1 (3) {
["seconds"]=>
int(1)
["nanoseconds"]=>
int(500000000)
["negative"]=>
bool(false)
}
Example #2 Measuring elapsed time with hrtime The above example will output something similar to:
object(Time\Duration)#1 (3) {
["seconds"]=>
int(0)
["nanoseconds"]=>
int(1062541)
["negative"]=>
bool(false)
}
See Also
|