From 18ba28b07c2fca80f5202bec558a8248c3323c6e Mon Sep 17 00:00:00 2001 From: bughoho Date: Tue, 29 Sep 2015 15:10:35 +0800 Subject: [PATCH] delete old code --- tests/test_iter_benchmark.c | 65 ------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 tests/test_iter_benchmark.c diff --git a/tests/test_iter_benchmark.c b/tests/test_iter_benchmark.c deleted file mode 100644 index 402c8a6f..00000000 --- a/tests/test_iter_benchmark.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Capstone Disassembler Engine */ -/* By Nguyen Anh Quynh , 2013> */ - -// This sample code demonstrates the APIs cs_malloc() & cs_disasm_iter(). -#include -#include -#include -#include "../myinttypes.h" - -#include - -static void test() -{ -#define X86_CODE32 "\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00" - /* origin version output: time used:2.683000 - * modified version output: time used:2.358000 - * if don't output format text string,like this: - //handle->printer(&mci, &ss, handle->printer_info); <-----cs.c line 700 - output:time used:1.138000 - */ - - csh handle; - uint64_t address; - cs_insn *insn; - int i; - cs_err err; - const uint8_t *code; - size_t size; - - err = cs_open(CS_ARCH_X86, CS_MODE_32, &handle); - if (err) { - printf("Failed on cs_open() with error returned: %u\n", err); - return; - } - cs_option(handle, CS_OPT_SYNTAX, CS_OPT_SYNTAX_INTEL); - cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); - - clock_t start, end; - double timeUsed; - - start = clock(); - int maxcount = 3400000; - insn = cs_malloc(handle); - for (i = 0; i < maxcount;) { - code = X86_CODE32; - address = 0x1000; - size = sizeof(X86_CODE32) - 1; - while(cs_disasm_iter(handle, &code, &size, &address, insn)) { - i++; - } - } - cs_free(insn, 1); - cs_close(&handle); - end = clock(); - timeUsed = (double)(end - start) / CLOCKS_PER_SEC; - printf("time used:%f\n", timeUsed); - getchar(); -} - -int main() -{ - test(); - - return 0; -}