implemented fast forward and max ff speed

This commit is contained in:
Shaun Inman 2023-01-28 22:30:48 -05:00
parent b3283adf0b
commit f9eee026f3
3 changed files with 98 additions and 10 deletions

View file

@ -5,6 +5,7 @@
#include <fcntl.h>
#include <math.h>
#include <ctype.h>
#include <sys/time.h>
#include "utils.h"
#include "defines.h"
@ -148,3 +149,15 @@ void putInt(char* path, int value) {
sprintf(buffer, "%d", value);
putFile(path, buffer);
}
uint64_t getMicroseconds(void) {
uint64_t ret;
struct timeval tv;
gettimeofday(&tv, NULL);
ret = (uint64_t)tv.tv_sec * 1000000;
ret += (uint64_t)tv.tv_usec;
return ret;
}

View file

@ -1,6 +1,8 @@
#ifndef UTILS_H
#define UTILS_H
#include <stdint.h>
int prefixMatch(char* pre, char* str);
int suffixMatch(char* suf, char* str);
int exactMatch(char* str1, char* str2);
@ -20,4 +22,6 @@ void getFile(char* path, char* buffer, size_t buffer_size);
void putInt(char* path, int value);
int getInt(char* path);
uint64_t getMicroseconds(void);
#endif