Sha256: 84c604463dd194bad261f3af3fe03259fc01249005d7b19f2bb5df5f74a162d1

Contents?: true

Size: 592 Bytes

Versions: 8

Compression:

Stored size: 592 Bytes

Contents

#ifndef CMARK_BENCH_H
#define CMARK_BENCH_H

#include <stdio.h>
#include <time.h>

#ifdef TIMER
float _cmark_start_time;
float _cmark_end_time;
float _cmark_save_time;

#define start_timer() \
	_cmark_save_time = _cmark_start_time; \
	_cmark_start_time = (float)clock()/CLOCKS_PER_SEC

#define end_timer(M) \
	_cmark_end_time = (float)clock()/CLOCKS_PER_SEC; \
	fprintf(stderr, "[TIME] (%s:%d) %4.f ns " M "\n", __FILE__, \
		__LINE__, (_cmark_end_time - _cmark_start_time) * 1000000); \
	_cmark_start_time = _cmark_save_time;

#else
#define start_timer()
#define end_timer(M)
#endif

#endif

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
commonmarker-0.3.0 ext/commonmarker/cmark/src/bench.h
commonmarker-0.2.1 ext/commonmarker/cmark/src/bench.h
commonmarker-0.2.0 ext/commonmarker/cmark/src/bench.h
commonmarker-0.1.3 ext/commonmarker/cmark/src/bench.h
commonmarker-0.1.2 ext/commonmarker/cmark/src/bench.h
commonmarker-0.1.1 ext/commonmarker/cmark/src/bench.h
commonmarker-0.1.0 ext/commonmarker/cmark/src/bench.h
commonmarker-0.0.1 ext/commonmarker/cmark/src/bench.h