You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
535 B
Objective-C
35 lines
535 B
Objective-C
#ifndef TIMER_H
|
|
#define TIMER_H
|
|
|
|
#include <time.h>
|
|
#include <stdint.h>
|
|
#include <yeslib.h>
|
|
#include <stdio.h>
|
|
|
|
#define NSEC_PER_SEC 1000000000
|
|
|
|
@interface Timer : YSObject {
|
|
@public
|
|
struct timespec start;
|
|
struct timespec current;
|
|
struct timespec pause_start;
|
|
struct timespec pause_current;
|
|
struct timespec diff;
|
|
int running;
|
|
int paused;
|
|
}
|
|
|
|
-(void) start;
|
|
-(void) pause;
|
|
-(void) resume;
|
|
-(void) stop;
|
|
-(void) tick;
|
|
|
|
//returns current minus start;
|
|
-(struct timespec) time;
|
|
-(char *) timeString;
|
|
|
|
@end
|
|
|
|
#endif
|