Ryan,
Thanks for your response. Yes, I mean .025 seconds and not milliseconds. My
mistake.
I've tried the SetSleepPolicy at all three setting (none, some and more) and
this
didn't seem to have much of an affect but changing the timer to .050 seconds
did reduce
CPU usage to under 40%. I may have to live with that and adjust the events I
process
within the Timer Callback accordingly.
The reason I wanted to reduce CPU usage is that I run a separate process
that acts as
a server for multiple clients and I allow one client to reside on the same
computer. I've
experienced slowdowns receiving TCP/IP messages on the client side (the one
resident
on the server computer) and was looking for ways to reduce overhead.
Once again, thanks. Your comments are appreciated.
George Hodgson
"ryank" wrote in message
news:506500000005000000BB9C0100-1079395200000@exchange.ni.com...
> Hi George,
>
> First, I'm assuming you mean .025 seconds rather than ms. If you are
> really trying to use .025 ms then that definitely explains your
> problem (getting better than about 1 ms of resolution for events on
> almost any windows box is highly unlikely). Assuming that you are
> using .025 seconds, then it's just a function of your computer's
> hardware setup. Doing the same program on my computer with the
> callback set to .025 seconds only uses about 40% of the processor. If
> all you want is to reduce your processor usage (generally not
> neccessary, ideally you should be using as much of your processor as
> possible at any given time, Windows is a preemptive OS, and will take
> the processor away if other things need it. However if you are
> running a parallel application which you need to maximize performance
> on then it might be good to reduce CVI's processor usage) you can
> change CVI's sleep policy to "Sleep More" using SetSleepPolicy (this
> can also be set under Options->Environment in CVI 7.0, but I'm not
> sure if or where the option is in 6.0). This will reduce the
> performance of your CVI code, but should cause it to use the processor
> less.
>
> Hope that helps,
> Ryan K.