Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 CPU Usage
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Sag




PostPosted: Wed Apr 14, 2004 11:06 pm   Post subject: CPU Usage

I have made a lot of programs before with Turing but am now trying to cut down the CPU Usage in my programs. I was just wondering if anyone knows how to cut down some of the CPU usage.

When i use the get command in turing and test it, it doesn't use any of the cpu usage but when i try to make it into an exe and run it when it gets to the Waiting for Input it uses 100% of the CPU.

Same thing happens when i use the Net.WaitForConnection but it uses 100% of the CPU when it is tested in turing and when its an exe.

Can anybody help me.

Thanks.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Apr 14, 2004 11:13 pm   Post subject: (No subject)

that's because those functions that 'wait' for something run a continues loop
code:

loop
exit when conditionMet
end loop

and that hogs all the CPU usage. I'm not sure if there's a way to go around that loop for Net.WaitForConnection function, but you can bypass waitloop for get using
code:

if hasch then
     getch(c)

model for input. You'd have to cover backspacing and return to compleat the function
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: