PHP » PYTHON |
login |
register |
about
|
PYTHON microtime
is this article helpful?
|
Python replacement for PHP's microtime
[
edit
| history
]
import time import datetime from datetime def microtime(get_as_float = False) : d = datetime.now() t = time.mktime(d.timetuple()) if get_as_float: return t else: ms = d.microsecond / 1000000. return '%f %d' % (ms, t) microtime(PHP 4, PHP 5) microtime — Return current Unix timestamp with microseconds Descriptionmicrotime() returns the current Unix timestamp with microseconds. This function is only available on operating systems that support the gettimeofday() system call. Parameters
Changelog
Examples
Example #1 Timing script execution with microtime()
<?php
Example #2 Timing script execution in PHP 5
<?php
|
more
Recently updated
more
Most requested
more
Last requests
|