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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news3.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Task Management Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1135769272.690177.182630@g47g2000cwa.googlegroups.com> Date: Wed, 28 Dec 2005 13:28:16 +0100 Message-ID: NNTP-Posting-Date: 28 Dec 2005 13:28:11 MET NNTP-Posting-Host: 022263a1.newsread2.arcor-online.net X-Trace: DXC=n@=Ah5\WKMfhlIa[YhA;>cQ5U85hF6f;djW\KbG]kaMhR5UHASZPC`n=`_g]ha^U\hWRXZ37ga[7jjTA67ckJ=XeAKP9YlInZ9` X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2381 Date: 2005-12-28T13:28:11+01:00 List-Id: On 28 Dec 2005 03:27:52 -0800, The One Who Rages wrote: > I am new to ada. You are welcome, though the following is not Ada question. > 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. See Win32 API procedure GetThreadTimes in MSDN. GNAT Ada tasks are most likely mapped to Windows threads. Call GetCurrentThread once from a task to identify it. The result is a pseudo handle. Use DuplicateHandle on it to get another (true) handle to the thread. This one can be used outside it (in another task.) P.S. GNAT has Win32 bindings. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de