4 Replies - 17088 Views - Last Post: 29 February 2016 - 08:53 AM Rate Topic: -----

#1 experimenting  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 11-July 12

How to control CPU's speed with C++ programming?

Posted 21 July 2012 - 04:59 PM

Is it possible to control CPU's speed through C++ programming??
If yes,How?

I just need an algorithm
..


OS-Window 7.
Is This A Good Question/Topic? 0
  • +

Replies To: How to control CPU's speed with C++ programming?

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 4835
  • View blog
  • Posts: 15,961
  • Joined: 05-May 12

Re: How to control CPU's speed with C++ programming?

Posted 21 July 2012 - 06:52 PM

You can look at the Power Management API's in the Windows API: http://msdn.microsof...3(v=vs.85).aspx

Why would you want to do this, though within your program? It's a user setting that the user should choose to control. What if the user is on a airplane with no chance to recharge, are you just going to suck up his battery because you feel like your program should be running with a faster CPU?

Sounds like malware to me.
Was This Post Helpful? 1
  • +
  • -

#3 psilocybin420  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 19-September 12

Re: How to control CPU's speed with C++ programming?

Posted 19 October 2012 - 01:23 PM

http://www.codeproje...ses-and-threads
it looks pretty simple and i dont even fully understand classes yet, hope it helps.
Was This Post Helpful? 0
  • +
  • -

#4 stevensrmiller  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 29-February 16

Re: How to control CPU's speed with C++ programming?

Posted 29 February 2016 - 08:49 AM

View PostSkydiver, on 21 July 2012 - 06:52 PM, said:

Why would you want to do this, though within your program? It's a user setting that the user should choose to control. What if the user is on a airplane with no chance to recharge, are you just going to suck up his battery because you feel like your program should be running with a faster CPU?

Sounds like malware to me.


Wow. One simple question got a moderator's instant condemnation. And the guy didn't even say he wanted to set the speed higher, or that his application was for anyone else's use. He might be doing research, or deploying just within his company. He might have his code detect battery usage and adjust. He might ask the user to approve the change (which you lightly toss off as "a user setting," but in Windows 7, changing the minimum processor setting is not something many users would know how to do).

Having apparently intimidated the OP into silence, I'd like to ask the question again: how can I set the CPU's speed from C++? I have a valid reason to want to know this, I am not writing malware, and I don't get intimidated by bumptious mods.
Was This Post Helpful? -1
  • +
  • -

#5 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 11614
  • View blog
  • Posts: 45,779
  • Joined: 12-June 08

Re: How to control CPU's speed with C++ programming?

Posted 29 February 2016 - 08:53 AM

Please do not dredge up old topics from 4+ years ago. I would suggest starting a new one.

If you decide to open a thread on the topic I would suggest dialing back the snark, providing what you have tried, and explain what is going on.

Also note - skydiver was not a moderator at that time.

Closing.

If you have questions on how the site works, rules, etc.. feel free to shoot me a PM.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1