添加内存锻炼器代码

This commit is contained in:
zsyg
2025-06-28 09:00:15 +08:00
committed by GitHub
parent 0efd3a9e32
commit 6df4a9a534
18 changed files with 800 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#ifndef BENCHMARK_H
#define BENCHMARK_H
#include <stddef.h>
// 内存性能测试结果
typedef struct {
double allocation_time; // 分配时间(ms)
double fill_time; // 填充时间(ms)
double free_time; // 释放时间(ms)
} BenchmarkResult;
// 运行内存性能测试
BenchmarkResult run_memory_benchmark(size_t size_mb);
// 打印测试结果(支持中文)
void print_benchmark_result(const BenchmarkResult* result);
#endif // BENCHMARK_H