source: eviacam/trunk/fuentes/wxutil/timeutil.cpp @ 29

Last change on this file since 29 was 29, checked in by mabarracus, 4 years ago

added eviacam content

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1/////////////////////////////////////////////////////////////////////////////
2// Name:        timeutil.cpp
3// Purpose: 
4// Author:      Cesar Mauri Loba (cesar at crea-si dot com)
5// Modified by:
6// Created:     
7// Copyright:   (C) 2008 - 2010 Cesar Mauri Loba - CREA Software Systems
8//
9//  This program is free software: you can redistribute it and/or modify
10//  it under the terms of the GNU General Public License as published by
11//  the Free Software Foundation, either version 3 of the License, or
12//  (at your option) any later version.
13//
14//  This program is distributed in the hope that it will be useful,
15//  but WITHOUT ANY WARRANTY; without even the implied warranty of
16//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17//  GNU General Public License for more details.
18//
19//  You should have received a copy of the GNU General Public License
20//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21/////////////////////////////////////////////////////////////////////////////
22#include "timeutil.h"
23
24#if defined(WIN32)
25// Windows
26#include <windows.h>
27#else
28// Linux
29#include <stdlib.h>
30#include <sys/time.h>
31#endif
32
33unsigned long CTimeUtil::GetMiliCount()
34{
35#if defined(WIN32)
36        // Windows
37        return GetTickCount();
38#else
39        // Linux
40        struct timeval tv;
41        //struct timezone tz;
42        gettimeofday(&tv, NULL); //&tz);
43
44        return (((unsigned long) tv.tv_sec * 1000000 + (unsigned long) tv.tv_usec) / 1000);
45#endif 
46}
Note: See TracBrowser for help on using the repository browser.