You can use microtime(true)
to get the current Unix timestamp with microseconds, and subtract it from the boot time which you can get from the /proc/uptime
file.
Here's an example code snippet:
main.php293 chars9 lines
This will output the system boot time in milliseconds. Note that this will only work on Linux systems.
gistlibby LogSnag