Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

gettimeofday in linux to windows platform

Posted on 2004-08-06
9
Medium Priority
?
958 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 11

Accepted Solution

by:
avizit earned 100 total points
ID: 11741969
one way would be to install cygwin  ( http://cygwin.com/ )

0
 

Author Comment

by:albusaidi
ID: 11742074
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 100 total points
ID: 11743164
How is gettimeofday() used?  If it is used as an interval timer, on Windows
you can call GetTickCount() instead.

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:teratoma
ID: 11745789
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
 
LVL 3

Expert Comment

by:teratoma
ID: 12094599
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

618 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