| delorie.com/archives/browse.cgi | search |
| From: | Alex Vinokur <alexvn AT bigfoot DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Getting high resolution time |
| Date: | Sun, 04 Nov 2001 14:06:19 +0200 |
| Organization: | Scopus Network Technologies |
| Lines: | 41 |
| Message-ID: | <3BE52F3B.C4129F05@bigfoot.com> |
| References: | <Pine DOT SUN DOT 3 DOT 91 DOT 1011104132426 DOT 19105D-100000 AT is> |
| NNTP-Posting-Host: | gateway.scopus.co.il (194.90.203.161) |
| Mime-Version: | 1.0 |
| X-Trace: | fu-berlin.de 1004875591 34571933 194.90.203.161 (16 [79865]) |
| X-Mailer: | Mozilla 4.7 [en] (Win98; I) |
| X-Accept-Language: | en |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Eli Zaretskii wrote:
> On Sun, 4 Nov 2001, Alex Vinokur wrote:
>
> > Alex Vinokur wrote:
> >
> > > Is there in DJGPP something like the gethrtime() function in UNIX ?
> >
> > P.S. I need it on Windows98.
>
> Then you should abandon hope to have an accurate timing: Windows has its
> own ideas about what you need.
>
> Our `uclock' does a fairly good job on Windows as well, but be prepared
> to some surprises.
I would like to make clear this point for Windows98 and gpp-2.95.3
I have some function foo().
I would like to measure its average cost-time in nanoseconds, something like
:
start = ????
for (i = 0; i < iters; i++)
foo ();
end = ????
printf("Avg time = %lld nsec\n", (end - start) / iters);
Is it possible ?
===========================
Alex Vinokur
mailto:alexvn AT bigfoot DOT com
mailto:alexvn AT dr DOT com
http://up.to/alexvn
http://go.to/alexv_math
===========================
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |