Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

delay() function with gcc on Linux?

895 views
Skip to first unread message

Marc O. Gloor

unread,
Jun 24, 1999, 3:00:00 AM6/24/99
to

Hello,

I'm looking for a function like delay() which is part of the
Borland C compiler under DOS. Under Linux, I can't find an
equal function?

Including <asm/delay.h> and the delay() function doesn't work
correctly with my gcc on GNU/Linux 2.0.

Does anybody can help me?


--
Marc Gloor / System Engineer e-mail: marc....@kuoni.ch
Kuoni Travel Ltd. (kuoni.com) PublicKeyID: 0x2CDBF3A1
Headoffice Zurich Phone: +41-1-277-42-92

http://hp.globacom.net/mgloor

J.H.M. Dassen (Ray)

unread,
Jun 24, 1999, 3:00:00 AM6/24/99
to
Marc O. Gloor <marc....@kuoni.ch> wrote:
>I'm looking for a function like delay() which is part of the Borland C
>compiler under DOS. Under Linux, I can't find an equal function?

sleep(3) is the recommended (portable) solution. nanosleep(2) has a more
finegrained resolution, but is less portable.

>Including <asm/delay.h> and the delay() function doesn't work correctly
>with my gcc on GNU/Linux 2.0.

On modern Linux system, as an application programmer you should never have
to include headers in <asm/*>, unless you really, really know what you are
doing. <asm/*> is kernel-specific.

HTH,
Ray
--
LEADERSHIP A form of self-preservation exhibited by people with auto-
destructive imaginations in order to ensure that when it comes to the crunch
it'll be someone else's bones which go crack and not their own.
- The Hipcrime Vocab by Chad C. Mulligan

Joe Durusau

unread,
Jun 24, 1999, 3:00:00 AM6/24/99
to
Sorry I'm not too familiar with linux, but you should realize
that this is a system library function. Posting to a linux group
might get you some insight as to how the delay() function works,
as might trying

man -s 2 delay

The compiler has nothing to do with how the delay function works.

Speaking only for myself,

Joe Durusau


"Marc O. Gloor" wrote:
>
> Hello,


>
> I'm looking for a function like delay() which is part of the
> Borland C compiler under DOS. Under Linux, I can't find an
> equal function?
>

> Including <asm/delay.h> and the delay() function doesn't work
> correctly with my gcc on GNU/Linux 2.0.
>

0 new messages