Added benchmark

This commit is contained in:
2024-12-05 01:59:32 +01:00
parent d153b44e1e
commit 62233df3e5
10 changed files with 335 additions and 62 deletions
+1 -7
View File
@@ -55,15 +55,9 @@ const masks = [_][4][4]u8{
};
pub fn main() !void {
const time_start = std.time.microTimestamp();
setMatrice('.');
try fillMatrice();
const total = countMask();
const time_end = std.time.microTimestamp();
print("Total time: {d}μs\n", .{time_end - time_start});
print("Total: {d}\n", .{total});
try std.testing.expectEqual(2401, countMask());
}
fn evaluate(mask: [4][4]u8, sub: [4][4]u8) bool {
+1 -7
View File
@@ -27,15 +27,9 @@ const masks = [_][3][3]u8{
};
pub fn main() !void {
const time_start = std.time.microTimestamp();
setMatrice('.');
try fillMatrice();
const total = countMask();
const time_end = std.time.microTimestamp();
print("Total time: {d}μs\n", .{time_end - time_start});
print("Total: {d}\n", .{total});
try std.testing.expectEqual(1822, countMask());
}
fn evaluate(mask: [3][3]u8, sub: [3][3]u8) bool {