vvopensource
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
VVStopwatch.h
1 
2 #if IPHONE
3 #import <UIKit/UIKit.h>
4 #else
5 #import <Cocoa/Cocoa.h>
6 #endif
7 #include <sys/time.h>
8 #import <libkern/OSAtomic.h>
9 
10 
11 
13 
16 @interface VVStopwatch : NSObject {
17  struct timeval startTime;
18  OSSpinLock timeLock;
19 }
20 
22 + (id) create;
23 
25 - (void) start;
27 - (double) timeSinceStart;
29 - (void) getFullTimeSinceStart:(struct timeval *)dst;
31 - (void) startInTimeInterval:(NSTimeInterval)t;
33 - (void) copyStartTimeToTimevalStruct:(struct timeval *)dst;
35 - (void) setStartTimeStruct:(struct timeval *)src;
36 
37 @end
38 
39 void populateTimevalWithFloat(struct timeval *tval, double secVal);
This class is used to measure how long it takes to do things; much easier to work with than NSDate...
Definition: VVStopwatch.h:16