Thread: time class / i need help!

  1. #1

    Question high-res timer class / please help!

    i want to write a simple cross-platform c++ timer
    class able to at least get millisecond-precise
    time spans. i can do the win32 part but i don't
    know much about the unix side.

    so what i need is somebody doing the unix part.

    i googled and found this
    http://bama.ua.edu/cgi-bin/man-cgi?gethrtime+3C
    won't be much work i guess.


    the only details about the public interface i have in mind for now is this

    Code:
    class CCrossTimer
    {
    	public:
    		double get_passed_time( bool bUpdateLast );
    		bool has_passed( double fMS, bool bUpdateLast, double * fTimePassed = NULL );
    		...
    };
    anybody wanna work with me?
    would be great!
    Last edited by hartwork; 03-25-2005 at 11:00 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    sorry, but how does that help!?

    i need somebody
    * to dicuss the class design with
    * doing the unix implementation


    can you do this?

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    >>sorry, but how does that help!?

    Quote Originally Posted by Salems Link
    DESCRIPTION

    The gettimeofday() function gets and the settimeofday()
    function sets the system's notion of the current time. The
    current time is expressed in elapsed seconds and
    microseconds
    since 00:00 Universal Coordinated Time

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    I'm sorry, I didn't realise someone attempting cross-platform code needed quite so much spoon feeding
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    if you can do the unix part you could help me.

    i'd also do the cross-platform stuff == putting unix and
    win32 part together (mainly preprocessor stuff).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need help in time zone
    By Gong in forum C++ Programming
    Replies: 2
    Last Post: 01-03-2007, 04:44 AM
  2. Help with assignment!
    By RVDFan85 in forum C++ Programming
    Replies: 12
    Last Post: 12-03-2006, 12:46 AM
  3. help working with class files for first time
    By jrb47 in forum C++ Programming
    Replies: 12
    Last Post: 11-30-2006, 09:20 AM
  4. I apologize. Good bye.
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-03-2002, 06:51 PM
  5. Difficulty superclassing EDIT window class
    By cDir in forum Windows Programming
    Replies: 7
    Last Post: 02-21-2002, 05:06 PM