mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 19:41:47 +01:00
port perfnotes to windows. addresses #1246
git-svn-id: file:///svn/toku/tokudb.1032b@8046 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
b232b6e23e
commit
755bb35712
7 changed files with 55 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
/* Insert a bunch of stuff */
|
||||
|
||||
#include <portability.h>
|
||||
#include <toku_portability.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Scan the bench.tokudb/bench.db over and over. */
|
||||
|
||||
#include <portability.h>
|
||||
#include <toku_portability.h>
|
||||
#include <assert.h>
|
||||
#include <db.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CPPFLAGS = -I../../include -I..
|
||||
CFLAGS = -Wall -Werror -g -O0
|
||||
LDFLAGS = ../tokulinux.a
|
||||
LDFLAGS = ../tokulinux.a
|
||||
SRCS = $(wildcard test-*.c)
|
||||
TARGETS = $(patsubst %.c,%,$(SRCS))
|
||||
|
||||
|
@ -9,5 +9,8 @@ all: $(TARGETS)
|
|||
%: %.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
||||
|
||||
test-gettime: test-gettime.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) -lrt
|
||||
|
||||
clean:
|
||||
rm -rf $(TARGETS)
|
17
linux/tests/test-gettime.c
Normal file
17
linux/tests/test-gettime.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
#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;
|
||||
}
|
14
linux/tests/test-gettimeofday.c
Normal file
14
linux/tests/test-gettimeofday.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
#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;
|
||||
}
|
2
linux/toku_time.h
Normal file
2
linux/toku_time.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include <time.h>
|
||||
#include <sys/time.h>
|
16
windows/toku_time.h
Normal file
16
windows/toku_time.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#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
|
Loading…
Add table
Reference in a new issue