[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 783
  • Last Modified:

g++ wait command

I have wrote a while loop that reads one line at a time and sends an email to the user. I was using strcpy & strcat to move in to memory and then system(buffer) to run it. Locked up the server because it was too much all at once. I have been tring to figure out how to put a wait(seconds) command between each while loop.

I tried
wait(2);
pause(2);

What am I over looking.

Thanks in advance.
Bob Ross
0
bross073097
Asked:
bross073097
  • 3
1 Solution
 
jakedCommented:
You want sleep(seconds). wait() waits for a child process to die, and pause() pauses until a signal is received.

0
 
bross073097Author Commented:
Thanks, I was at wit's end with this.

Bob

0
 
bross073097Author Commented:
I tried sleep(10);

When I compiled it g++ test.c I received

implicit declaration of function 'int sleep(...)'

What did I miss.

Thanks
Bob Ross
0
 
bross073097Author Commented:
I got it, I forgot to put the unistd.h #include

Thanks

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now