LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-30-2004, 10:38 PM   #1
slickenside
LQ Newbie
 
Registered: Jan 2004
Location: jl ace 08, gaten, condongcatur, depok, sleman, yogyakarta, INDONESIA 55281
Distribution: SuSE, RedHat Fedora
Posts: 3

Rep: Reputation: 0
Talking delay(), gettime() inside dos.h and conio.h in LINUX


how this implementation for dos.h and conio.h, i cant find gettime() and delay() function in LINUX ?
how its best solution for it?

best regards,
slickenside
 
Old 01-30-2004, 10:40 PM   #2
slickenside
LQ Newbie
 
Registered: Jan 2004
Location: jl ace 08, gaten, condongcatur, depok, sleman, yogyakarta, INDONESIA 55281
Distribution: SuSE, RedHat Fedora
Posts: 3

Original Poster
Rep: Reputation: 0
add:
how this implementation header from dos.h and conio.h for LINUX ?
 
Old 01-31-2004, 01:10 AM   #3
Kumar
Member
 
Registered: Sep 2003
Location: Pune, India
Distribution: Red Hat
Posts: 106

Rep: Reputation: 15
There is no such header files as dos.h and conio.h in Linux . You will have to use gettimeofday() defined in sys/time.h and sleep() or nanosleep() defined in unistd.h and time.h respectively. Hope this helps.

Last edited by Kumar; 01-31-2004 at 01:11 AM.
 
Old 01-31-2004, 02:12 AM   #4
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
CONIO.H is a DOS specific header file, so you are out of luck. For console access, use ncurses.
Do a
Code:
man ncurses
to learn more.
 
Old 01-31-2004, 03:57 AM   #5
slickenside
LQ Newbie
 
Registered: Jan 2004
Location: jl ace 08, gaten, condongcatur, depok, sleman, yogyakarta, INDONESIA 55281
Distribution: SuSE, RedHat Fedora
Posts: 3

Original Poster
Rep: Reputation: 0
how many argument can get passing in gettimeofday(). how it can be realize it with hours, minutes, second and milisecond.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <sys/unistd.h>




signed int Pangt_rek( int X,int Y);

signed int Pang_ite(int X, int y);



int n;

float t, t1, t2, Rek, Ite;

signed int j, m, d, md, m1, d1, md1; /* global variable */

signed int Pangt_rek( int X,int Y){
delay(10);
if (Y == 0)
return 1.0;
else
return (Pangt_rek(X, Y - 1) * X);
}

signed int Pang_ite(int X, int y){

signed int i;
int Hasil;

if (y != 0) {
delay(10);
Hasil *= X;
}
}

main(int argc,char *argv[]){
printf("2 pangkat n = \t iteratif= \t rekursif= \t");
do {
printf("%d", 6);
gettime(j, m, d, md);
Ite = Pangt_ite(2, n,);
gettime(j, m1, d1, md1);
t1 = m * 600 + d * 100 + md;
t2 = m1 * 600 + d1 * 100 + md1;
t = (t2 - t1) / 100.0;
printf(" : %6.2f", t)
gettime(j, m, d, md);
Rek = Pangt_rek(2, n);
gettimeofday(j, m1, d1, md1);
t1 = m * 600 + d * 100 + md;
t2 = m * 600 + d1 * 100 + md1;
t = (t2 - t1)/100.0;
printf(" : %6.2f\n", t)
} while (n < 130);

n = n + 5;

return EXIT_SUCCESS;

}

how to implement to this code :

gettime(param hours, minute, second, milisecond);

best regards,
slickenside
 
Old 01-31-2004, 03:20 PM   #6
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
I could not understand your english.
 
Old 01-31-2004, 05:13 PM   #7
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
type :
man gettimeofday to read more about it
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables inside client to inside host with outside DNS or IP - Help! linuxhelp2 Linux - Networking 1 10-15-2005 06:19 AM
CONIO.H in linux like in DOS ravikumarG Programming 3 04-21-2005 02:03 AM
conio.h?? jojopopo0372 Programming 3 09-07-2004 03:11 AM
ConIO.h Mohsen Linux - General 4 09-04-2004 03:46 PM
conio.h matt_w_lambert Programming 9 07-19-2003 12:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration