Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8751901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:08:00+00:00 2026-06-13T13:08:00+00:00

I am trying create cpu load generator tool. In which my input will be

  • 0

I am trying create cpu load generator tool. In which my input will be a number which is in between 0-100. I m using time function for calculating the load and i check the load. If load exceeds a desired value i try to sleep the process. The issue i m facing i that i get a desired load for but only for time period of 500ms or more. Not less than that. I m checking the load on a tool called as ‘top’. When i try to decrease the time period in top. I observe the load fluctuations. Is there any ways to make a process sleep for 1ms or less.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:08:01+00:00Added an answer on June 13, 2026 at 1:08 pm

    Since you tagged this question linux-kernel, I will answer with specific details about the Linux scheduler…

    Short answer: no you can’t sleep for less that 1ms, because that’s the resolution of the scheduler. In other words, the kernel is waking up every millisecond to decide which process to schedule, so sleeping for less than that is not possible.

    Long answer: designing a cpu load generator for Linux was a subject complicated enough to deserve multiple publications. You can try the terms cpu burner and cpu load generator on Google Scholar to find more info. One of the most efficient way now is not to do it: there is cpu bandwith limitation in the cgroups feature of any recent kernel, meaning you don’t have to execute code to limit the amount of cpu time available to other processes.

    And no, nanosleep does not provide any guaranty that your process will be stopped, only that the clock advanced at least the amount of time you requested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create 100 files using FileOutputStream/BufferedOutputStream. I can see the CPU
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I'm trying to create a script that will allow me to monitor CPU Utilization,
I am trying to create a simple cpu using verilog but i couldn't. I
I am trying to create tiles using generate_tiles.py and every time I run the
Ok so I am trying create a login script, here I am using PHP5
Trying to create a macro which can be used for print debug messages when
I am trying to create an installer for my project using NAnt. this is
I'm trying to create a function that returns frequency of IOS device's processor. The
Recently i've been trying to create a wait function that waits for 25 ms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.