spielwiese
Last change
on this file since 2cfffe was
2cfffe,
checked in by Hans Schönemann <hannes@…>, 21 years ago
|
This commit was generated by cvs2svn to compensate for changes in r6316,
which included commits to RCS files with non-trunk default branches.
git-svn-id: file:///usr/local/Singular/svn/trunk@6317 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
454 bytes
|
Line | |
---|
1 | #include <NTL/config.h> |
---|
2 | |
---|
3 | #include <time.h> |
---|
4 | |
---|
5 | |
---|
6 | #if (defined(__cplusplus) && !defined(NTL_CXX_ONLY)) |
---|
7 | extern "C" double _ntl_GetTime(); |
---|
8 | #endif |
---|
9 | |
---|
10 | |
---|
11 | double _ntl_GetTime(void) |
---|
12 | { |
---|
13 | static clock_t last_clock = 0; |
---|
14 | static double acc = 0; |
---|
15 | |
---|
16 | clock_t this_clock; |
---|
17 | double delta; |
---|
18 | |
---|
19 | this_clock = clock(); |
---|
20 | |
---|
21 | delta = (this_clock - last_clock)/((double)CLOCKS_PER_SEC); |
---|
22 | if (delta < 0) delta = 0; |
---|
23 | |
---|
24 | acc += delta; |
---|
25 | last_clock = this_clock; |
---|
26 | |
---|
27 | return acc; |
---|
28 | } |
---|
29 | |
---|
Note: See
TracBrowser
for help on using the repository browser.