2 * returns the time since a fixed point in resolutions */
| 148 | * returns the time since a fixed point in resolutions |
| 149 | */ |
| 150 | int getRTimer() |
| 151 | { |
| 152 | struct timeval now; |
| 153 | |
| 154 | gettimeofday(&now, &tzp); |
| 155 | |
| 156 | if (startRl.tv_usec > now.tv_usec) |
| 157 | { |
| 158 | now.tv_usec += 1000000; |
| 159 | now.tv_sec --; |
| 160 | } |
| 161 | |
| 162 | double f =((double) (now.tv_sec - startRl.tv_sec))*timer_resolution + |
| 163 | ((double) (now.tv_usec - startRl.tv_usec))*timer_resolution / |
| 164 | (double) 1000000; |
| 165 | |
| 166 | return (int)(f+0.5); |
| 167 | } |
| 168 | |
| 169 | /*2 |
| 170 | * stops timer, writes string s and the time since last call of startTimer |
no test coverage detected