This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: win2k download utility


That would still waste some CPU cycles that could have been used
somewhere else.  I've never used Sleep in windows myself.  I usually
just set a timer, and let windows deal with when I should receive the
message.  It's not always perfectly accurate, but for a non-realtime
app, it doesn't really matter that much.  It's usually completely
accurate when the system is not loaded.

-----Original Message-----
From: Lewin A.R.W. Edwards [mailto:larwe@larwe.com] 
Sent: Monday, June 11, 2001 9:07 AM
To: Trenton D. Adams; ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] win2k download utility


>OMG, that's the worst programming technique I've seen.  No wonder my
>mouse won't move hardly when it's over the cygwin window.  The stupid
>loops they use hog the CPU.  I changed the 2000 to 200 in the uspin
>function.  It's a lot faster now.  Isn't there a sleep function in
linux
>that takes milliseconds?

Well, it was a DOS program, designed for single-tasked operation :)))

BTW, as a random aside: Sleep() in Win32 doesn't seem to give quite the 
expected results to me. It's better to have a polled loop that peeks a 
message queue and terminates when time() exceeds some known value.



-- Lewin A.R.W. Edwards
Embedded Engineer, Digi-Frame Inc.
Work: http://www.digi-frame.com/
Tel (914) 937-4090 9am-6:30pm M-F ET
Personal: http://www.larwe.com/ http://www.zws.com/

"Far better it is to dare mighty things, to win glorious triumphs, even 
though checkered by failure, than to rank with those poor spirits who 
neither enjoy much nor suffer much, because they live in the gray 
twighlight that knows not victory nor defeat."
(Theodore Roosevelt)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]