📄 bench.c
字号:
#define BENCHMARK 200
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include "idea.h"
void main()
{
DWORD start, t;
double e;
int i;
unsigned short iv[8];
unsigned char key[] = "Cobble up some key for this benchmark.";
static unsigned char buffer[8000];
printf("Running benchmark: please be patient.\n");
initcfb_idea(iv, key, FALSE);
start = GetTickCount();
for (i = 0; i < BENCHMARK; i++) {
ideacfb(buffer, sizeof buffer);
}
t = GetTickCount() - start;
e = (((double) BENCHMARK * (sizeof buffer) * 1000.0) / t);
// printf("%ld bytes in %ld milliseconds:\n", (long) BENCHMARK * (sizeof buffer), t);
printf("%.0f bytes per second.\n", e);
printf("\nPlease E-mail the line:\n\n %.0f\n\nalong with a description of your machine\n", e);
printf("(for example 486/50) to kelvin@fourmilab.ch.\n\nThank you!\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -