gettimeofday in linux to windows platform


Hi... I completed by project in Linux platform and now I what to convert it to windows platform
but wjen I start compiling in C++ compiler( both borland and visual c++ ) the compiler can't recognized gettimeofday which return type (timeval ) which can be second or milsecond???
so what can I do ???
If I plan to change the source code will impact many class....
albusaidiAsked:
Who is Participating?
 
avizitConnect With a Mentor Commented:
one way would be to install cygwin  ( http://cygwin.com/ )

0
 
albusaidiAuthor Commented:
did You try it before .. I mean even all function used in linex like gettimeof day will be in windows after I dowload this tools.
Thank You
0
 
brettmjohnsonConnect With a Mentor Commented:
How is gettimeofday() used?  If it is used as an interval timer, on Windows
you can call GetTickCount() instead.

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
teratomaCommented:
The portable solution would be to use the functions in time.h.  Cygwin should work if you just want to move a simple UNIX program to Windows, since it works with a lot of complex utilities that need to know the time of day.  Once you get Cygwin working it should feel familiar to a linux user.
0
 
ole111Commented:
0
 
teratomaCommented:
I posted a more complete recommendation so I should get more points :)  Requiring a Windows user to install Cygwin in order to use your software is a pretty bad answer, so I recommended using time.h which is standard.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.