From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1d629cbff6c439a6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Task Management References: <1135769272.690177.182630@g47g2000cwa.googlegroups.com> From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:TJFboPTTVWRWR0Cnk09MVixZzKU= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 28 Dec 2005 07:33:05 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1135773185 66.159.65.1 (Wed, 28 Dec 2005 07:33:05 EST) NNTP-Posting-Date: Wed, 28 Dec 2005 07:33:05 EST Xref: g2news1.google.com comp.lang.ada:2382 Date: 2005-12-28T07:33:05-05:00 List-Id: "The One Who Rages" 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