tags:

views:

156

answers:

2

HI I need a function to cpu load ( percentage ) and another function to get Memory load In PHP

+1  A: 

If you use linux, you can retrieve it from shell.

Edit: shell_exec

usoban
A: 

memory_get_usage()

int memory_get_usage  ([ bool $real_usage= false  ] )

Returns the amount of memory, in bytes, that's currently being allocated to your PHP script.

I'm not sure there's a simple, portable way of measuring CPU load. Are you on Linux?

therefromhere