The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unix Arithmatic operation issue , datatype issue thambi Shell Programming and Scripting 23 02-19-2008 07:19 AM
Sleep() not working enuenu High Level Programming 2 06-02-2007 02:01 AM
Sleep less than 1 second bjorno UNIX for Dummies Questions & Answers 9 08-25-2005 04:55 AM
Sleep under one second Scoogie Shell Programming and Scripting 5 08-14-2002 09:10 AM
sleep Anna UNIX for Dummies Questions & Answers 5 07-11-2001 12:52 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-04-2007
josejesus3340 josejesus3340 is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 4
Sleep or Dealy fucntion Issue

I am doing some programming using C on UNIX. The thing is, I have been working in both UNIX and Windows for practicing.

I created a Delay fucntion over Windows using DevC++ as a compiler, when I tried over the console, it worked as I expected, I mean it was creating a delay (of one second for example) between each operation.

When I tried this function over UNIX, it didn't get the same results. I would like to know what is happening. Then, I tried a Sleep function from the <unistd.h> library and it did the same. When I tried to do an operation that will be printed in the same line, the delay used between each operation is acummulated and then everything is done. For example;

Sleep(1); printf("Hi"); Sleep(1); printf("How"); Sleep(1); printf("are"); Sleep(1); printf("you?");

I have to wait four seconds to get all the expression to be printed in the screen, instead of getting each expresion with a one second delay. I hope somebody can help me out. I will aprecciate any help.

Other thing, I have been using the conio.h library of windows to put some color on the console. What can I used on UNIX? Can anybody give a working example?
 

Bookmarks

Tags
knoppix, linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0