summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libcsupport/src/__times.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/libcsupport/src/__times.c')
-rw-r--r--c/src/exec/libcsupport/src/__times.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/c/src/exec/libcsupport/src/__times.c b/c/src/exec/libcsupport/src/__times.c
index eab408e8d3..3b23f3764a 100644
--- a/c/src/exec/libcsupport/src/__times.c
+++ b/c/src/exec/libcsupport/src/__times.c
@@ -35,25 +35,20 @@ clock_t _times(
return -1;
}
- /* "POSIX" does not seem to allow for not having a TOD */
- status = rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
- if ( status != RTEMS_SUCCESSFUL ) {
- assert( 0 );
- return -1;
- }
-
/*
- * RTEMS has no notion of system versus user time and although
- * a way to keep track of per task CPU usage was added since
- * 3.6.0, this routine does not utilize it yet.
+ * RTEMS technically has no notion of system versus user time
+ * since there is no separation of OS from application tasks.
+ * But we can at least make a distinction between the number
+ * of ticks since boot and the number of ticks executed by this
+ * this thread.
*/
- ptms->tms_utime = ticks;
- ptms->tms_stime = 0;
+ ptms->tms_utime = _Thread_Executing->ticks_executed;
+ ptms->tms_stime = ticks;
ptms->tms_cutime = 0;
ptms->tms_cstime = 0;
- return 0;
+ return ticks;
}
/*