Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 21 20:50:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8M3oE9l019053 for ; Sun, 21 Sep 2008 20:50:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m8M3qV1H008079 for ; Sun, 21 Sep 2008 20:52:31 -0700 Message-Id: <200809220352.m8M3qV1H008079@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: gettimeofday() Date: Sun, 21 Sep 2008 20:52:31 -0700 From: Bill Cheng Someone wrote: > I am using the following code. > > struct timeval t; > gettimeofday(&t, NULL); > printf("In time(secs) = %ld and time(usecs) = %ld\n", t.tv_sec, t.tv_usec); > > The output I am getting is: > > *In time(secs) = 1222046245 and time(usecs) = 919384* > > How is the seconds value lesser ? Why not? The way to read the above is that the current time is 1222046245.919384 seconds since Jan 1st, 1970. -- Bill Cheng // bill.cheng@usc.edu