|
Last change
on this file since 18 was 18, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
495 bytes
|
| Line | |
|---|
| 1 | /* times.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */
|
|---|
| 2 |
|
|---|
| 3 | #include <time.h>
|
|---|
| 4 | #include <sys/time.h>
|
|---|
| 5 | #include <sys/times.h>
|
|---|
| 6 |
|
|---|
| 7 | /* Note: return value overflows */
|
|---|
| 8 |
|
|---|
| 9 | long _times (struct tms *buffer)
|
|---|
| 10 | {
|
|---|
| 11 | struct timeval tv;
|
|---|
| 12 |
|
|---|
| 13 | buffer->tms_utime = clock (); /* clock () * HZ / CLOCKS_PER_SEC */
|
|---|
| 14 | buffer->tms_stime = 0;
|
|---|
| 15 | buffer->tms_cutime = 0;
|
|---|
| 16 | buffer->tms_cstime = 0;
|
|---|
| 17 | if (_gettimeofday (&tv, NULL) != 0)
|
|---|
| 18 | return -1;
|
|---|
| 19 | return CLK_TCK * tv.tv_sec + (CLK_TCK * tv.tv_usec) / 1000000;
|
|---|
| 20 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.