Hogwarts Wand Docs: ../server/ac_time.h

Wand Sourcecode: ../server/ac_time.h

//
// ac_time.h - time functions
//
// Copyright (C) 2006  Nathan (Acorn) Pooley
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 2 as published by the Free Software Foundation.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License (gpl.txt) for more details. 
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
// 
// You can contact the author, Nathan (Acorn) Pooley, by writing
// to Nathan (Acorn) Pooley, 949 Buckeye Drive, Sunnyvale, CA  94086, USA
// or through the form at http://www.rawbw.com/~acorn/wand/feedback.html
//
#ifndef AC_TIME_H
#define AC_TIME_H

//#@DOC@ time functions

//###########################################################################
//############################### NOTES #####################################
//###########################################################################
//
//  H   H   OOO   W   W        TTTTT   OOO        U   U   SSSS  EEEE
//  H   H  O   O  W W W          T    O   O       U   U  S      E
//  HHHHH  O   O  W W W          T    O   O       U   U   SSS   EEE
//  H   H  O   O  WWWWW          T    O   O       U   U      S  E
//  H   H   OOO    W W           T     OOO         UUU   SSSS   EEEEE
//
// 1) To get time
//        AcTime t;
//        AcTimeGet(&t);
//        t->sec   // this is seconds since epoch
//        t->usec  // this is microseconds since last second
//
// 2) To compare times t1 and t0 where t1 > t0
//        AcTime diff;
//        AcTimeDiff(&diff, &t1, &t0);
//
//        // diff is the difference.  diff is 0,0 if t1<t0
//

//###########################################################################
//############################### TYPEDEFS ##################################
//###########################################################################

typedef long AcTimeSec;
typedef long AcTimeUSec;

//
// Guaranteed to have:
//     sec         - signed, at least 32 bits
//     usec
//
typedef struct AcTimeRec {
    AcTimeSec  sec;
    AcTimeUSec usec;
} AcTime;

//###########################################################################
//############################### PROTOTYPES ################################
//###########################################################################

int AcTimeGet(AcTime *result);
int AcTimeDiff(AcTime *result, AcTime *t1, AcTime *t0);




#endif // AC_TIME_H

This file Copyright (C) 2006 by Nathan (Acorn) Pooley
Go to TOP Wand page
Go to Acorn's personal webpage
Go to Hogwarts website: www.gotohogwarts.com
Snout: www.snout.org/game
Gadgets of Justice Unlimited
Snout GC (Wiki)
Snout Wiki
File created by do_doc at Wed May 30 03:30:11 PDT 2007