Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Why do simple apps and games use lots of CPU time?

Author
Message
GameMaker Jason
21
Years of Service
User Offline
Joined: 22nd Nov 2003
Location: UK
Posted: 2nd Mar 2004 19:15
I made a simple program will prints hello world on the screen but when I open task manager it says it's using 90% of the CPU time and about 4000KB memory. why is it so high and how do i get it down?

Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 2nd Mar 2004 19:32
im afraid there's nothing you can do about it. Its the way darkbasic works

Quote: "
UPDATED

Amd 2800+ | 1024mb pc3200 | A7N8eluxe | Ati Radeon 9800PRO 256mb
"
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 2nd Mar 2004 23:05
DB is intended to run games, not display hello world , take a look at what Halflife or Quake arena use, most games are not multitasking, they grab the whole PC to themselves, in the old days they even replaced the whole OS with a faster-cut down version for extra speed, cpu usage was normaly 105% (ie-games still ran a little slow on your machine)

Mentor.

1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, 2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 3rd Mar 2004 01:40 Edited at: 3rd Mar 2004 01:45
Use SYNC OFF, it stops dbpro grabbing 100% of the cpu.
e.g.


It's really only usefull for apps where consistant timing isn't required.
If you are going to use it in a game make sure you include an option to use the normal sync methods otherwise users with slower comps won't be able to play. There is also quite a difference between how SYNC OFF behaves in win9x and win2k.

I think you can use SYNC OFF and then use SYNC ON when you want to do something as fast as possible then switch back to SYNC OFF again.
e.g


You will have to test that yourself as I am not 100% sure it works.
Macrosii
20
Years of Service
User Offline
Joined: 31st Mar 2004
Location: Essex, UK
Posted: 31st Mar 2004 18:34
Hi,

Just tried your 1st code snipet and DB still grabs 99% of the CPU (under W2K)?
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 31st Mar 2004 18:47 Edited at: 31st Mar 2004 18:48
Quote: "Just tried your 1st code snipet and DB still grabs 99% of the CPU (under W2K)?"


Odd it is between 0-2% here in win2k. Unless you have dbc, I think it only works in the newer versions of dbpro.
Macrosii
20
Years of Service
User Offline
Joined: 31st Mar 2004
Location: Essex, UK
Posted: 1st Apr 2004 14:45
Upgraded to the lastes version and now runs at 0%. Thanks

Login to post a reply

Server time is: 2024-11-26 10:34:58
Your offset time is: 2024-11-26 10:34:58