source: trunk/third/rpm/db/os_win32/os_clock.c @ 19079

Revision 19079, 736 bytes checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r19078, which included commits to RCS files with non-trunk default branches.
Line 
1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 2001-2002
5 *      Sleepycat Software.  All rights reserved.
6 */
7
8#include "db_config.h"
9
10#ifndef lint
11static const char revid[] = "Id: os_clock.c,v 1.7 2002/07/12 18:56:53 bostic Exp ";
12#endif /* not lint */
13
14#include <sys/types.h>
15#include <sys/timeb.h>
16#include <string.h>
17
18#include "db_int.h"
19
20/*
21 * __os_clock --
22 *      Return the current time-of-day clock in seconds and microseconds.
23 */
24int
25__os_clock(dbenv, secsp, usecsp)
26        DB_ENV *dbenv;
27        u_int32_t *secsp, *usecsp;      /* Seconds and microseconds. */
28{
29        struct _timeb now;
30
31        _ftime(&now);
32        if (secsp != NULL)
33                *secsp = (u_int32_t)now.time;
34        if (usecsp != NULL)
35                *usecsp = now.millitm * 1000;
36        return (0);
37}
Note: See TracBrowser for help on using the repository browser.