![]() |
|
#1
|
|||
|
|||
Measuring time? Help!I just need to write a simple program to measure time, but am not sure what I'm doing wrong.
CPP / C++ / C Code:
The error is (probably obviously) where I am trying to access suseconds_t from the timeval structure. Thanks for your help. |
|||
|
#2
|
||||
|
||||
Re: Measuring time? Help!Please post any errors messages verbatim, as this will make it possible for others to help more readily even if they have no experience with gettimeofday() or timeval structure.
Moving on, I see the following problems (note that some may not really be problems in your program if there are lines of code that you did not post, I am just assuming you posted it all to be safe):
CPP / C++ / C Code:
Matthew P.S. I used <cstdio> and operator new and removed the (unecessary) keyword struct because this is the C++ forum. A few small changes, such as reintroducing struct and using malloc/free, could make this a correct C program. __________________
I was born not knowing and have only had a little time to change that here and there. -- Richard P. Feynman Boris Podolsky: James! How's the rat business? James Moreland: Well, actually it's mostly students I'm experimenting on now. Kurt Gödel: My God, the mazes must be enormous. Last edited by QED : 10-Apr-2006 at 10:24.
Reason: To clarify the code sample.
|
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating a time converter | tylerfelix | C++ Forum | 15 | 20-Nov-2005 21:34 |
| Simulation Problem | wu_weidong | C++ Forum | 7 | 12-Mar-2005 23:56 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
| time Problem | zuzupus | MySQL / PHP Forum | 9 | 24-Jul-2003 08:02 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The