comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Task execution time test
Date: Thu, 30 Dec 2010 09:54:47 +0100
Date: 2010-12-30T09:54:46+01:00	[thread overview]
Message-ID: <1msa4k5ed4kcg.586dr1u71qpq.dlg@40tude.net> (raw)
In-Reply-To: 4d1bbd6e$0$7701$ba4acef3@reader.news.orange.fr

On Thu, 30 Dec 2010 00:00:10 +0100, h_poincare wrote:

> Here are the measures of the code on my Windows machines
> which tend to prove that the scheduling is correct.
> 
> On Windows Vista SP2 :
> For 1_000 loops
> Seconds 0 Fraction 0.093600600
> For 10_000 loops
> Seconds 1 Fraction 0.029606600
> 
> On Windows XP2002 SP3 :
> For 1_000 loops
> Seconds 0 Fraction 0.125000000
> Seconds 0 Fraction 0.109375000
> For 10_000 loops
> Seconds 1 Fraction 0.140625000
> 
> GPS 4.4.1 (20091215) hosted on i686-pc-mingw32
> GNAT GPL 2010 (20100603)

I think you have a multi-core processor. In effect the measured task does
not lose the processor as the test intends. Make sure that the number of
worker task is sufficiently high to make busy all cores.

(I have posted a better test in a new thread.)

> I am just curious to know how to get/set Windows performance counters

QueryPerformanceCounter returns a 64-bit integer. QueryPerformanceFrequency
gives the frequency of the counter.

Relation of both may serve a replacement for Ada.Real_Time.Clock. Beware
multi-cores. Each core has its own counter. That means, you cannot mix
counts from different cores. SetThreadAffinityMask can be used to glue the
task to a core.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



      reply	other threads:[~2010-12-30  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-26 10:25 Task execution time test Dmitry A. Kazakov
2010-12-29 23:00 ` h_poincare
2010-12-30  8:54   ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox