Mail Archives: djgpp/1996/08/29/19:22:07
Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:
:
: On 21 Aug 1996, Sam Phillips wrote:
:
: > I've been trying to time some code with HRTIMER and everytime it runs the
: > program it returns with a 0 for how long the operation took.
:
: What is HRTIMER?
This is the code I use for timing programs. It works fine for me. The
resolution is 1/18 of a second.
--
============================================
Without my guitar, I am a poet without arms.
- Michael Bloomfield
============================================
#include <stdio.h>
#include <process.h>
#include <time.h>
int main(int argc, char *argv[])
{
int status;
clock_t start = clock();
status = spawnvp(P_WAIT, argv[1], argv + 1);
fprintf(stderr, "elapsed time: %.2f seconds\n",
(float)(clock() - start) / CLK_TCK);
return status;
}
- Raw text -