Commit 755bb357 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

port perfnotes to windows. addresses #1246

git-svn-id: file:///svn/toku/tokudb.1032b@8046 c7de825b-a66e-492c-adef-691d508d4ae1
parent b232b6e2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* Insert a bunch of stuff */ /* Insert a bunch of stuff */
#include <portability.h> #include <toku_portability.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
......
/* Scan the bench.tokudb/bench.db over and over. */ /* Scan the bench.tokudb/bench.db over and over. */
#include <portability.h> #include <toku_portability.h>
#include <assert.h> #include <assert.h>
#include <db.h> #include <db.h>
#include <errno.h> #include <errno.h>
......
CPPFLAGS = -I../../include -I.. CPPFLAGS = -I../../include -I..
CFLAGS = -Wall -Werror -g -O0 CFLAGS = -Wall -Werror -g -O0
LDFLAGS = ../tokulinux.a LDFLAGS = ../tokulinux.a
SRCS = $(wildcard test-*.c) SRCS = $(wildcard test-*.c)
TARGETS = $(patsubst %.c,%,$(SRCS)) TARGETS = $(patsubst %.c,%,$(SRCS))
...@@ -9,5 +9,8 @@ all: $(TARGETS) ...@@ -9,5 +9,8 @@ all: $(TARGETS)
%: %.c %: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS)
test-gettime: test-gettime.c
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) -lrt
clean: clean:
rm -rf $(TARGETS) rm -rf $(TARGETS)
\ No newline at end of file
#include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include <toku_time.h>
int main(void) {
int r;
struct timespec ts;
r = clock_gettime(CLOCK_REALTIME, &ts);
assert(r == 0);
sleep(10);
r = clock_gettime(CLOCK_REALTIME, &ts);
assert(r == 0);
return 0;
}
#include <stdio.h>
#include <assert.h>
#include <toku_time.h>
int main(void) {
int r;
struct timeval tv;
struct timezone tz;
r = gettimeofday(&tv, &tz);
assert(r == 0);
return 0;
}
#include <time.h>
#include <sys/time.h>
#ifndef TOKU_TIME_H
#define TOKU_TIME_H
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
int gettimeofday(struct timeval *tv, struct timezone *tz);
#ifdef __cplusplus
};
#endif
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment