Jwang add resource measurements

if resource profiling mode is enabled only?