calculate user and system resource usage