-#if defined(PROFILING) || defined(DEBUG)
- GC_start_time = getProcessCPUTime(); // needed in mut_user_time_during_GC()
-#endif
-
- if (RtsFlags.GcFlags.giveStats != NO_GC_STATS) {
-#if !defined(PROFILING) && !defined(DEBUG)
- GC_start_time = getProcessCPUTime();
-#endif
- GCe_start_time = getProcessElapsedTime();
+ if (RtsFlags.GcFlags.giveStats != NO_GC_STATS
+ || RtsFlags.ProfFlags.doHeapProfile)
+ // heap profiling needs GC_tot_time
+ {
+ getProcessTimes(&GC_start_time, &GCe_start_time);