Re: Is delphi a good introduction to programming?
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 May 2005 01:48:50 +0200
"Paul Dunn" <paul.dunn4@xxxxxxxxxxxx> wrote in message
news:Xh_fe.468$Nt.153@xxxxxxxxxxxxxxxxxxxxxxx
[...]
> The biggest problem I encountered (and have yet to find a solution for)
> is that when running the emulation in the idle loop, everything runs
> smoothly until some other application takes any CPU time, at which point
> my app stalls and stutters. My app consumes about 1-2% CPU time, and if
> another app takes any more than 4% CPU then my app is stalled. I can't
> figure that out at all. My loop consists of emulating a frame (20ms, or
> 69888 cycles) of Z80 code, then sleeps in 1ms intervals until the full
> real 20ms has elapsed. This typically results in 18-19ms of sleep time
> per frame, but I still get the stuttering.
>
> I think it's a fault of application.run; but I have no idea how to get
> around it :(
Isn't 20 ms close to Windows' own timeslice? Perhaps quantisation is
behind this.
You can either be nice and surrender your timeslice when you're not
using it, but then you're at Windows' mercy with regard to when it
comes back to you, or you can be accurate and spin - but spinning 90%
of the time or more might bother me, too.
Did you try other frame lengths? And Sleep(0) instead of Sleep(1)?
Groetjes,
Maarten Wiltink
.
- Follow-Ups:
- Re: Is delphi a good introduction to programming?
- From: Bruce Roberts
- Re: Is delphi a good introduction to programming?
- References:
- Is delphi a good introduction to programming?
- From: casioculture
- Re: Is delphi a good introduction to programming?
- From: fphsml
- Re: Is delphi a good introduction to programming?
- From: Paul Dunn
- Re: Is delphi a good introduction to programming?
- From: alanglloyd@xxxxxxx
- Re: Is delphi a good introduction to programming?
- From: Paul Dunn
- Re: Is delphi a good introduction to programming?
- From: Alf Christophersen
- Re: Is delphi a good introduction to programming?
- From: Paul Dunn
- Re: Is delphi a good introduction to programming?
- From: Bruce Roberts
- Re: Is delphi a good introduction to programming?
- From: Paul Dunn
- Re: Is delphi a good introduction to programming?
- From: Maarten Wiltink
- Re: Is delphi a good introduction to programming?
- From: Paul Dunn
- Re: Is delphi a good introduction to programming?
- From: Maarten Wiltink
- Re: Is delphi a good introduction to programming?
- From: Paul Dunn
- Is delphi a good introduction to programming?
- Prev by Date: Re: Delphi and .NET newbie question (help!)
- Next by Date: Re: Creating EXE files programmatically
- Previous by thread: Re: Is delphi a good introduction to programming?
- Next by thread: Re: Is delphi a good introduction to programming?
- Index(es):
Relevant Pages
|