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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,212d0edbd5d28969 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-29 15:54:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!freenix!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-text.cableinet.net.POSTED!53ab2750!not-for-mail From: "Karen" Newsgroups: comp.lang.ada References: Subject: Re: Cpu usage in ada? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4920.2300 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 Message-ID: Date: Tue, 29 Oct 2002 23:54:14 GMT NNTP-Posting-Host: 62.30.215.71 X-Complaints-To: abuse@blueyonder.co.uk X-Trace: news-text.cableinet.net 1035935654 62.30.215.71 (Tue, 29 Oct 2002 23:54:14 GMT) NNTP-Posting-Date: Tue, 29 Oct 2002 23:54:14 GMT Organization: blueyonder (post doesn't reflect views of blueyonder) Xref: archiver1.google.com comp.lang.ada:30209 Date: 2002-10-29T23:54:14+00:00 List-Id: "Sim Con" 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!