Re: Task Management



"The One Who Rages" <Krzysztof.Daniel@xxxxxxxxx> writes:

> Hello
>
> I am new to ada.
> I am trying to develop a simple system for managing
> different(predefined) tasks.
> I need to know time consumption for each task(f.e task with id 1 used
> 213 ms of processor). Could anyone point me vision of solution?
> I can estimate of course, but it is not sattisfactying me.
>
> I work under winXP, with gnat compiler.

Using standard Ada, you can measure "wall clock time" for each task,
with Ada.Calendar. In each task, store the start and end time, by
calling Ada.Calendar.Clock.

But if the tasks interrupt each other, this is _not_ the per-task CPU
usage.

There is probably a Win32 API for this. Go to
http://msdn.microsoft.com/library, and search around. When you find
it, see if it is already imported in the GNAT Win32 bindings. Then see
if you can make it work :).

--
-- Stephe
.



Relevant Pages

  • Object with zero bits
    ... For the Ada implementation of the binary data part of CytometryML, ... using a discriminant to control a variant record where I need to store an ... like to be able to have the user determine which ones he or she will store. ... I do have the luxury that I can wait for Ada 2005. ...
    (comp.lang.ada)
  • Task Management
    ... I am new to ada. ... I am trying to develop a simple system for managing ... I need to know time consumption for each task(f.e task with id 1 used ... Prev by Date: ...
    (comp.lang.ada)
  • Re: Reading Float Data from a binary file into ada
    ... Is it stored like an ieee standard? ... Ada and C are the same in this regard -- Ada and C compilers will ... typically store Floats in the way the hardware normally stores them, ... that C float and Ada Float are represented the same way on the same ...
    (comp.lang.ada)
  • Re: Task Management
    ... though the following is not Ada question. ... > I am trying to develop a simple system for managing ... with gnat compiler. ... See Win32 API procedure GetThreadTimes in MSDN. ...
    (comp.lang.ada)
  • Re: generic package with procedure paramter gives "not subtype conformant with declaration"
    ... when the values come from C and are never dereferenced by the Ada. ... Once i store the access in the pointer i no longer need to know ... and treat them in Ada as a black box, size 32, content unknown. ...
    (comp.lang.ada)