linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: r_zaca <r_zaca@ig.com.br>
To: linux-c-programming@vger.kernel.org
Subject: Nanoseconds
Date: Wed, 24 Aug 2005 16:08:54 -0300	[thread overview]
Message-ID: <20050824_190854_092976.r_zaca@ig.com.br> (raw)

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 840 bytes --]

  Hello all, 

  I need a way to get the date of my linux machine in seconds and 
nanoseconds. In seconds I know I can you some of the standards function of 
lib C (that give me the date since the "epoch"), but my problem is to get 
the nanoseconds. I was reading about clock_gettime. It seems to solve my 
problem, but when I try to compile and link it, I get an error message like 
that: 

cc     time.c   -o time 
/tmp/ccOKP0zk.o(.text+0x21): In function `main': 
: undefined reference to `clock_gettime' 
collect2: ld returned 1 exit status 
make: *** [time] Error 1 

I know its a linker error, that is, the linker doesn't not know here to find 
this function. 
Doesn't this function belong to the standard gnu libc? 
Have anyone heard about "clock_gettime"? If someone knows how it is 
implemented, I'd appreciate so much. 

Thanks. 

             reply	other threads:[~2005-08-24 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24 19:08 r_zaca [this message]
2005-08-24 19:29 ` Nanoseconds Steve Graegert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050824_190854_092976.r_zaca@ig.com.br \
    --to=r_zaca@ig.com.br \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).