comp.lang.ada
 help / color / mirror / Atom feed
From: "Karen" <karen.nussbaum@blueyonder.co.uk>
Subject: Re: Cpu usage in ada?
Date: Tue, 29 Oct 2002 23:54:14 GMT
Date: 2002-10-29T23:54:14+00:00	[thread overview]
Message-ID: <GcFv9.2151$w32.17772596@news-text.cableinet.net> (raw)
In-Reply-To: b4a38a5f675eb2c7e9430d1b934558a4.110780@mygate.mailgate.org


"Sim Con" <sicon@hotmail.com> wrote in message
news:b4a38a5f675eb2c7e9430d1b934558a4.110780@mygate.mailgate.org...
> Hello! I need to build a cpu usage meter in ada95 for a windows system.
> Any help? ^_^ Thanx in advance!!
>
>
> --
> Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

You have to make a decision of whether you want to poll (recording which bit
of code is running), instrument the entry and exit of routines, or simply
absorb the remaining CPU power and to see what is left.

Polling is not much good if your code is 'synchronised'.  For example a
program with a few short lived routines (say < 10ms) triggered on a timer
will not even show up on a polling CPU measurement system (such as is
available with Windows bundled), as they poll on clock tick boundaries.  If
the logic is stimulated randomly, then polling can work, but random means
data arriving from off machine, and even then you can get beating effects.

Building a simple CPU consumer, and forcing it to run low priority is easy
enough.  Beware, though, of multiple CPU machines - not a problem on windows
98 of course, but it can be for windows 2000 onwards.

If you want to instrument (see how many times code is called), you should
try some of the free stuff that comes with GNAT (gprof).  Its not so great
at recording anything other than the main thread, but you can frig it to
work on one other thread if you work at it a bit.

Good luck!





  reply	other threads:[~2002-10-29 23:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-29 15:51 Cpu usage in ada? Sim Con
2002-10-29 23:54 ` Karen [this message]
2002-10-30  3:38   ` SteveD
2002-10-30 14:24     ` Ted Dennison
2002-10-30  3:35 ` SteveD
2002-10-30 14:35   ` Ted Dennison
2002-10-30  4:56 ` Ted Dennison
replies disabled

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