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

  • SEARCH
  • Home
  • 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 7498511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:30:07+00:00 2026-05-29T19:30:07+00:00

I wrote a little console application, and I want it to pause for a

  • 0

I wrote a little console application, and I want it to pause for a certain number of seconds before the cycle (a while) starts again.

I’m working on Windows operating system.

  • 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-05-29T19:30:08+00:00Added an answer on May 29, 2026 at 7:30 pm

    On Windows, the function to do this is Sleep, which takes the amount of milliseconds you want to sleep. To use Sleep, you need to include windows.h.

    On POSIX-Systems, the function sleep (from unistd.h) accomplishes this:

       unsigned int sleep(unsigned int seconds);
    
       DESCRIPTION
              sleep()  makes  the  calling thread sleep until
              seconds seconds have elapsed or a signal arrives which is not ignored.
    

    If it is interrupted by a signal, the remaining time to sleep is returned. If you use signals, a more robust solution would be:

     unsigned int time_to_sleep = 10; // sleep 10 seconds
     while(time_to_sleep)
         time_to_sleep = sleep(time_to_sleep);
    

    This is of course assuming your signal-handlers only take a negligible amount of time. (Otherwise, this will delay the main program longer than intended)

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

Sidebar

Related Questions

I wrote little WPF application with 2 threads - main thread is GUI thread
I wrote a little monkeypatch to the Rails MySQLAdapter and want to package it
I've been playing with Python for a while and wrote a little program to
I like to write a little server application being controlled by a little console
I wrote a little commandline-application in Java and wanted to use the new class
i wrote a little addin, which does some formatting of my C# code. in
I wrote a little daemon in Perl that calls up FFMpeg to encode a
i wrote a little test programm which queries the status servlet of a tomcat
I wrote a little search script for a client, it works and words get
I wrote a little program that solves 49151 sudoku's within an hour for an

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.