Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

os_clock.c

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2001-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: os_clock.c,v 12.1 2005/06/16 20:23:28 bostic Exp $
00008  */
00009 
00010 #include "db_config.h"
00011 
00012 #include <sys/types.h>
00013 #include <sys/timeb.h>
00014 #include <string.h>
00015 
00016 #include "db_int.h"
00017 
00018 /*
00019  * __os_clock --
00020  *      Return the current time-of-day clock in seconds and microseconds.
00021  */
00022 void
00023 __os_clock(dbenv, secsp, usecsp)
00024         DB_ENV *dbenv;
00025         u_int32_t *secsp, *usecsp;      /* Seconds and microseconds. */
00026 {
00027         struct _timeb now;
00028 
00029         _ftime(&now);
00030         if (secsp != NULL)
00031                 *secsp = (u_int32_t)now.time;
00032         if (usecsp != NULL)
00033                 *usecsp = now.millitm * 1000;
00034 }

Generated on Sun Dec 25 12:14:42 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2