| 120 | } |
| 121 | |
| 122 | void stopTime(txSample* theSample) |
| 123 | { |
| 124 | struct timespec time; |
| 125 | clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time); |
| 126 | theSample->duration += ((double)(time.tv_sec) - (double)(theSample->time.tv_sec)) |
| 127 | + (((double)(time.tv_nsec) - (double)(theSample->time.tv_nsec)) / 1000000000.0); |
| 128 | theSample->count++; |
| 129 | } |
| 130 | |
| 131 | txSample gxLifeTime = { { 0, 0 }, 0, 0, "life" }; |
| 132 | txSample gxMarkTime = { { 0, 0 }, 0, 0, "mark" }; |