Click here to Skip to main content
16,019,089 members
Please Sign up or sign in to vote.
1.00/5 (7 votes)
Hey guys,
i was wondering how can i make my C program (which let's say is a Keylogger) use less CPU.

I ask you especially for some C code that i insert to my source code and make my program even always use less CPU or just "Sleep" it for a while.

Answer ASAP please.
Thanks for your time.
Posted
Updated 10-Jan-12 1:20am
v2
Comments
Mohibur Rashid 9-Jan-12 18:26pm    
Did you try any program that work normally?
XristosMr 10-Jan-12 7:21am    
What do you mean by this?

And why would you want that?
I can't think of many legitimate reasons for wanting that particular combination of features...
 
Share this answer
 
Comments
XristosMr 9-Jan-12 14:12pm    
I amn't sure what program i am going to write, but it could be a keylogger. I just want it to make my program use less CPU and if it is a keylogger then run on a stealth mode.
Can you help me?
OriginalGriff 9-Jan-12 14:16pm    
Why would I help you write what sounds like malicious code?
XristosMr 9-Jan-12 14:33pm    
OK then don't spam me!
Sergey Alexandrovich Kryukov 9-Jan-12 21:15pm    
Who is spamming? You are. You are reported for abuse for this post and the question.
--SA
Wonde Tadesse 9-Jan-12 19:51pm    
5+. Congratulation for your MVP
1. Keyloggers are definitely malicious.

2. Writing a program 'in the manner of a keylogger' is also by definition malicious. Why wouldn't you want your program to be discoverable/managable by the user? If you are looking to hide your program from users, you want to hide it for a reason.. and honestly I can't come up with a reason to hide a program from users that doesn't involve malicious intent.

This makes you someone wishing to write malicious software. You'll find little support for such things on this site. We are all professionals, some of us working on products that battle malicious programs.
 
Share this answer
 
There is no C code that you can add to a program to use less CPU. It will use as much CPU as required by the execution of the instructions in the program. Maybe you need to explain in better detail exactly what problem you are trying to solve, just as long as it's not about hacking.
 
Share this answer
 
Comments
Albert Holguin 10-Jan-12 9:34am    
+5, hasn't been invented yet....lol
Richard MacCutchan 10-Jan-12 9:46am    
It would be a useful feature though. :D

Albert Holguin 10-Jan-12 9:54am    
Well get to work Richard... it would make a great CP article! :D
The best way for you to make your application to use less CPU and resources is to use this really cool exit(); function. It works really well. You'll find that your application will sleep really well and use virtually no resources.
 
Share this answer
 
v2
If you want it to use less CPU then write fewer instructions. If you want to run it in stealth mode then that suggests you are or wish to be a hacker: we do not support such people on this site.
 
Share this answer
 
Comments
CPallini 9-Jan-12 16:59pm    
Nah, sir. The 'goto Here' application is one on the most CPU intensive I've ever written...
Richard MacCutchan 10-Jan-12 3:21am    
We had a similar one on the old Univac 1108 machine that could freeze the system with a single assembler instruction.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900