comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
Subject: Re: Task Management
Date: Wed, 28 Dec 2005 07:33:05 -0500
Date: 2005-12-28T07:33:05-05:00	[thread overview]
Message-ID: <uy825xuym.fsf@acm.org> (raw)
In-Reply-To: 1135769272.690177.182630@g47g2000cwa.googlegroups.com

"The One Who Rages" <Krzysztof.Daniel@gmail.com> 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



  parent reply	other threads:[~2005-12-28 12:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-28 11:27 Task Management The One Who Rages
2005-12-28 12:28 ` Dmitry A. Kazakov
2005-12-28 12:55   ` Martin Dowie
2005-12-28 12:33 ` Stephen Leake [this message]
2005-12-28 13:22 ` The One Who Rages
  -- strict thread matches above, loose matches on Subject: below --
1999-06-17  0:00 Task management Dale Stanbrough
1999-06-17  0:00 ` Larry Kilgallen
1999-06-17  0:00 ` Decker, Christian R
1999-06-17  0:00   ` Gerald Kasner
replies disabled

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