time class / i need help!

This is a discussion on time class / i need help! within the Linux Programming forums, part of the Platform Specific Boards category; i want to write a simple cross-platform c++ timer class able to at least get millisecond-precise time spans. i can ...

  1. #1
    CS Student hartwork's Avatar
    Join Date
    Apr 2004
    Posts
    35

    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    CS Student hartwork's Avatar
    Join Date
    Apr 2004
    Posts
    35
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    CS Student hartwork's Avatar
    Join Date
    Apr 2004
    Posts
    35
    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, 07:51 PM
  5. Difficulty superclassing EDIT window class
    By cDir in forum Windows Programming
    Replies: 7
    Last Post: 02-21-2002, 05:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21