Solved

gettimeofday in linux to windows platform

Posted on 2004-08-06
9
865 Views
Last Modified: 2008-02-07

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....
0
Comment
Question by:albusaidi
9 Comments
 
LVL 11

Accepted Solution

by:
avizit earned 25 total points
Comment Utility
one way would be to install cygwin  ( http://cygwin.com/ )

0
 

Author Comment

by:albusaidi
Comment Utility
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
 
LVL 23

Assisted Solution

by:brettmjohnson
brettmjohnson earned 25 total points
Comment Utility
How is gettimeofday() used?  If it is used as an interval timer, on Windows
you can call GetTickCount() instead.

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 3

Expert Comment

by:teratoma
Comment Utility
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
 

Expert Comment

by:ole111
Comment Utility
0
 
LVL 3

Expert Comment

by:teratoma
Comment Utility
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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now