Board index » delphi » detecting the CPU speed
Tim
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Tim
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
detecting the CPU speed
i'd like to have my BP app incorporate different levels of features
based on the speed of the user's CPU. it's a heavy-graphic app, so i'm thinking the minimum system req. is a P-133. i'd like to be able to determine the mhz, from 60 to 450. i've seen lots of chip detectors, that can tell you if it's a 386, 486, whatever, but that's not really usefull for my purposes. any help greatly appreciated. please cc to my email if posting a response, thanks. |
Ing. Franz Glase
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedQuoteTim wrote: Var Timer18:Integer absolute $0040:$006C; Function GetSpeed : Longint; Franz Glaser |
Frederi
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedIng. Franz Glaser schrieb: Quote> Var Timer18:Integer absolute $0040:$006C; single clock cycle to execute? So that, therefore, after the loop, Cntr contains the number of clock cycles after a second? But the loop itself also takes some time, the comparison for example. |
Pedt Scrag
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedIn comp.lang.pascal.borland, Frederic uttered: Quote>Ing. Franz Glaser schrieb: information. The first repeat .. until loop waits until the second changes and the if Cntr = 2000 then delay for period of time 10 The loop itself will indeed take some time. It may be preferable to add For TP6 and 7 use For TP5 and 5.5 use -- No-one is completely useless, they can always be a bad example. |
Dr John Stockto
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedJRS: In article <363A5769.B2FE0...@eunet.at> of Sat, 31 Oct 1998 01:18:49 in comp.lang.pascal.borland, Ing. Franz Glaser <meg- Quotegla...@eunet.at> wrote: for J := 0 to 1 do begin Cntr := 0; SavTimer := Timer18; Repeat Inc(Cntr); Until SavTimer <> Timer18; end ; Actually, it would be better in principle to have Timer18 a word or a Alas, I cannot now examine the code produced by BP from Pascal in News -- |
Jason Burg
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedIn article: <363A0411.94C26...@xmission.com> Tim <x...@xmission.com> writes: Quote
graphics card, since the speed from one card to the next can vary enormously. You could do this by accessing the video RAM within your CPU timing loop, in which case it will give you some sort of composite speed rating, or you might want to perform a separate video card speed test. In either case relative timings (to a known machine and video card) will Jay ----------------------------------------- |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedIn article <363AF092.A15A...@rz-online.de>, QuoteFrederic <frede...@rz-online.de> wrote: Quote> So that, therefore, after the loop, Cntr than one measure especially if one runs some multitasking system. Osmo |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedIn article <12219018...@jayman.demon.co.uk>, QuoteJason Burgon <Ja...@jayman.demon.co.uk> wrote: fast enough is very subjective and a programmer cannot decide it for all users. I would be really annoyed if I would either lose some features or have to suffer some needless effects just because some programmer thought that I should do so because I have some specific CPU. Osmo |
Timo Sal
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speed:>Ing. Franz Glaser schrieb: :>> Var Timer18:Integer absolute $0040:$006C; :>> Function GetSpeed : Longint; I made some testing of the posted code. Unfortunately, it turned out I say this only constructively! It would have been nice to have this All the best, Timo .................................................................... Spam foiling in effect. My email filter autoresponder will return a |
Wouter Ra
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedAbout one and a half years ago I wrote a routine which determines the CPU speed for my Acorn Atom emulator. For most processors it comes pretty close (e.g. for 486 DX40 is gives values about 38-40, for P120 values 118-121, for P233 values 231-233, depending whether the program is run in native DOS mode or in a DOS box under Windows). It has been written with TP7.0. Execution time is hardly noticable. Here's the code. Near label @Timer2 the DBs and DW form the instruction Kind regards, ----------------------------------------------------- function GetCPUSpeed: Word; |
Dr John Stockto
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedJRS: In article <71tai4$...@majakka.uwasa.fi> of Fri, 6 Nov 1998 00:58:12 in comp.lang.pascal.borland, Timo Salmi <t...@UWasa.Fi> wrote: Quote>I made some testing of the posted code. Unfortunately, it turned out unreliable in a Windows DOS Box - *perhaps* one should wait more than one tick before starting timing, to ensure full cacheing on a system where the code may be swapped out. In pure DOS, I do believe that one can get meaningful results; though if There's a *bit* at my http://www.merlyn.demon.co.uk/pas-time.htm#Misuse -- |
Bill Boult
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:detecting the CPU speedQuoteOn Fri, 30 Oct 1998 11:23:13 -0700, Tim <x...@xmission.com> wrote: I believe it is not possible to obtain any accurate indication of cpu On the subject of graphics performance, I know from experience that I submit this for your consideration and appologise for not having a Bill. |