| Line |  | 
|---|
| 1 | /* | 
|---|
| 2 | * synergy -- mouse and keyboard sharing utility | 
|---|
| 3 | * Copyright (C) 2002 Chris Schoeneman | 
|---|
| 4 | * | 
|---|
| 5 | * This package is free software you can redistribute it and/or | 
|---|
| 6 | * modify it under the terms of the GNU General Public License | 
|---|
| 7 | * found in the file COPYING that should have accompanied this file. | 
|---|
| 8 | * | 
|---|
| 9 | * This package is distributed in the hope that it will be useful, | 
|---|
| 10 | * but WITHOUT ANY WARRANTY without even the implied warranty of | 
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 12 | * GNU General Public License for more details. | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 | #include "CArchTimeUnix.h" | 
|---|
| 16 | #if TIME_WITH_SYS_TIME | 
|---|
| 17 | #       include <sys/time.h> | 
|---|
| 18 | #       include <time.h> | 
|---|
| 19 | #else | 
|---|
| 20 | #       if HAVE_SYS_TIME_H | 
|---|
| 21 | #               include <sys/time.h> | 
|---|
| 22 | #       else | 
|---|
| 23 | #               include <time.h> | 
|---|
| 24 | #       endif | 
|---|
| 25 | #endif | 
|---|
| 26 |  | 
|---|
| 27 | // | 
|---|
| 28 | // CArchTimeUnix | 
|---|
| 29 | // | 
|---|
| 30 |  | 
|---|
| 31 | CArchTimeUnix::CArchTimeUnix() | 
|---|
| 32 | { | 
|---|
| 33 | // do nothing | 
|---|
| 34 | } | 
|---|
| 35 |  | 
|---|
| 36 | CArchTimeUnix::~CArchTimeUnix() | 
|---|
| 37 | { | 
|---|
| 38 | // do nothing | 
|---|
| 39 | } | 
|---|
| 40 |  | 
|---|
| 41 | double | 
|---|
| 42 | CArchTimeUnix::time() | 
|---|
| 43 | { | 
|---|
| 44 | struct timeval t; | 
|---|
| 45 | gettimeofday(&t, NULL); | 
|---|
| 46 | return (double)t.tv_sec + 1.0e-6 * (double)t.tv_usec; | 
|---|
| 47 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.