This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GNU-Win32 : gettimeofday


Lim Chu Cheow wrote:
> 
> Hi,
> I just installed b18, and compiled a simple program
> (given below).  Compilation went through, but the
> execution received some exception and died.  Am I
> missing something?  Thanks in advance for any advice.
> 
> ============
> #include <stdio.h>
> #include <sys/time.h>
> 
> void main(void)
> {
>   struct timeval tp;

add:
    struct timezone tz;

> 
>   fprintf(stdout,"Hello world!!\n");
>   gettimeofday(&tp);

replace:
    gettimeofday(&tp,&tz);

>   fprintf(stdout,"Current time = %lf s\n",
>           ((double)tp.tv_sec+tp.tv_usec*1.0e-6));
> }

-- 
  ,-/-  __      _  _         $Bill Luebkert
 (_/   /  )    // //       DBE Collectibles
  / ) /--<  o // //      http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_    Email: dbe@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]