Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
win32.c
Package: chapter15.rar [view]
Upload User: hjq518
Upload Date: 2021-12-09
Package Size: 5084k
Code Size: 1k
Category:
Audio program
Development Platform:
Visual C++
- /*!
- *************************************************************************************
- * file win32.c
- *
- * brief
- * Platform dependent code
- *
- * author
- * Main contributors (see contributors.h for copyright, address and affiliation details)
- * - Karsten Suehring <suehring@hhi.de>
- *************************************************************************************
- */
- #include "global.h"
- #ifdef _WIN32
- static LARGE_INTEGER freq;
- void gettime(TIME_T* time)
- {
- QueryPerformanceCounter(time);
- }
- time_t timediff(TIME_T* start, TIME_T* end)
- {
- static int first = 1;
- if(first)
- {
- QueryPerformanceFrequency(&freq);
- first = 0;
- }
- return (time_t)((end->QuadPart - start->QuadPart)* 1000 /(freq.QuadPart));
- }
- #else
- static struct timezone tz;
- void gettime(TIME_T* time)
- {
- gettimeofday(time, &tz);
- }
- time_t timediff(TIME_T* start, TIME_T* end)
- {
- time_t t1, t2;
- t1 = start->tv_sec * 1000 + (start->tv_usec/1000);
- t2 = end->tv_sec * 1000 + (end->tv_usec/1000);
- return t2-t1;
- }
- #endif