How to simulate different CPU frequency and limit RAM

Posted by user351103 on Stack Overflow See other posts from Stack Overflow or by user351103
Published on 2010-05-26T16:05:38Z Indexed on 2010/05/26 16:21 UTC
Read the original article Hit count: 409

Filed under:
|
|
|
|

Hi
I have to build a simulator with C#. This simulator should be able to run a second thread with configureable CPU speed and limited RAM size, e.g. 144MHz and 50 MB.
Of course I know that a simulator can never be as accurate as the real hardware. But I try to get almost similar performance.
At the moment I'm thinking about creating a thread which I will stop/sleep from time to time. Depending on the desired CPU speed the simulator should adjust the sleep time of this thread and therefore simulate different cpu frequency. To measure the achieved speed I though about using PerformanceCounters. But with this approach I have the problem that I don't know how to limit the RAM size the thread could use.
Do you have any ideas how to realize such a simulator?

Thanks in advance!!

© Stack Overflow or respective owner

Related posts about c#

Related posts about process