projects
/
platform
/
upstream
/
libxkbcommon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generate a tizen keymap header using a tizen key layout file - The tizen keylayout...
[platform/upstream/libxkbcommon.git]
/
bench
/
key-proc.c
diff --git
a/bench/key-proc.c
b/bench/key-proc.c
index
56b396a
..
1d29243
100644
(file)
--- a/
bench/key-proc.c
+++ b/
bench/key-proc.c
@@
-21,6
+21,8
@@
* DEALINGS IN THE SOFTWARE.
*/
* DEALINGS IN THE SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <time.h>
#include <stdlib.h>
#include <time.h>
@@
-30,7
+32,7
@@
#define BENCHMARK_ITERATIONS 20000000
static void
#define BENCHMARK_ITERATIONS 20000000
static void
-bench(struct xkb_state *state)
+bench
_key_proc
(struct xkb_state *state)
{
int8_t keys[256] = { 0 };
xkb_keycode_t keycode;
{
int8_t keys[256] = { 0 };
xkb_keycode_t keycode;
@@
-57,7
+59,7
@@
main(void)
struct xkb_context *ctx;
struct xkb_keymap *keymap;
struct xkb_state *state;
struct xkb_context *ctx;
struct xkb_keymap *keymap;
struct xkb_state *state;
- struct bench
_timer timer
;
+ struct bench
bench
;
char *elapsed;
ctx = test_get_context(0);
char *elapsed;
ctx = test_get_context(0);
@@
-73,15
+75,13
@@
main(void)
xkb_context_set_log_level(ctx, XKB_LOG_LEVEL_CRITICAL);
xkb_context_set_log_verbosity(ctx, 0);
xkb_context_set_log_level(ctx, XKB_LOG_LEVEL_CRITICAL);
xkb_context_set_log_verbosity(ctx, 0);
- srand(time(NULL));
-
- bench_timer_reset(&timer);
+ srand((unsigned) time(NULL));
- bench_
timer_start(&timer
);
- bench(state);
- bench_
timer_stop(&timer
);
+ bench_
start(&bench
);
+ bench
_key_proc
(state);
+ bench_
stop(&bench
);
- elapsed = bench_
timer_get_elapsed_time_str(&timer
);
+ elapsed = bench_
elapsed_str(&bench
);
fprintf(stderr, "ran %d iterations in %ss\n",
BENCHMARK_ITERATIONS, elapsed);
free(elapsed);
fprintf(stderr, "ran %d iterations in %ss\n",
BENCHMARK_ITERATIONS, elapsed);
free(elapsed);