diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
commit | a6c1ed4716cf02626ea035beb6dd4a921642ba80 (patch) | |
tree | ef582c1b52819e27bdd16097ec03b69799d04ede /newlib/libc/time/clock.c | |
parent | f6c9a624fa8a6878a7fb2b02f55e4990a20feb59 (diff) |
Use libc from agbcc instead of standalone newlib\nYou must have AGBCC commit 80d029caec189587f8b9294b6c8a5a489b8f5f88 in order to compile pmd_red.gbalibc
Diffstat (limited to 'newlib/libc/time/clock.c')
-rw-r--r-- | newlib/libc/time/clock.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/newlib/libc/time/clock.c b/newlib/libc/time/clock.c deleted file mode 100644 index b15915d..0000000 --- a/newlib/libc/time/clock.c +++ /dev/null @@ -1,69 +0,0 @@ -/* NetWare can not use this implementation of clock, since it does not - have times or any similar function. It provides its own version of - clock in clib.nlm. If we can not use clib.nlm, then we must write - clock in sys/netware. */ - -#ifdef CLOCK_PROVIDED - -int _dummy_clock = 1; - -#else - -/* - * clock.c - * Original Author: G. Haley - * - * Determines the processor time used by the program since invocation. The time - * in seconds is the value returned divided by the value of the macro CLK_TCK. - * If the processor time used is not available, (clock_t) -1 is returned. - */ - -/* -FUNCTION -<<clock>>---cumulative processor time - -INDEX - clock - -ANSI_SYNOPSIS - #include <time.h> - clock_t clock(void); - -TRAD_SYNOPSIS - #include <time.h> - clock_t clock(); - -DESCRIPTION -Calculates the best available approximation of the cumulative amount -of time used by your program since it started. To convert the result -into seconds, divide by the macro <<CLOCKS_PER_SEC>>. - -RETURNS -The amount of processor time used so far by your program, in units -defined by the machine-dependent macro <<CLOCKS_PER_SEC>>. If no -measurement is available, the result is <<-1>>. - -PORTABILITY -ANSI C requires <<clock>> and <<CLOCKS_PER_SEC>>. - -Supporting OS subroutine required: <<times>>. -*/ - -#include <time.h> -#include <sys/times.h> -#include <reent.h> - -clock_t -clock () -{ - struct tms tim_s; - clock_t res; - - if ((res = (clock_t) _times_r (_REENT, &tim_s)) != -1) - res = (clock_t) (tim_s.tms_utime + tim_s.tms_stime + - tim_s.tms_cutime + tim_s.tms_cstime); - - return res; -} - -#endif /* CLOCK_PROVIDED */ |