Skip to content

Commit

Permalink
Fully remove clock implementation
Browse files Browse the repository at this point in the history
This was only used by the old heartbeat mechanism
  • Loading branch information
judofyr committed Aug 9, 2024
1 parent e3b7d6b commit aa56de3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 53 deletions.
11 changes: 0 additions & 11 deletions examples/zig-parallel-example/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ pub fn main() !void {
defer arena.deinit();

var n: ?usize = null;
var measure_clock = false;
var csv: ?std.fs.File = null;
var enable_baseline = false;
var num_threads_list = std.ArrayList(usize).init(gpa.allocator());
Expand Down Expand Up @@ -256,8 +255,6 @@ pub fn main() !void {
const num_threads = std.fmt.parseInt(usize, num_threads_str, 10) catch failArgs("{} must be an integer", .{flag});
try num_threads_list.append(num_threads);
defaults = false;
} else if (flag.isLong("measure-clock")) {
measure_clock = true;
} else if (flag.isShort("h") or flag.isLong("help")) {
show_usage = true;
} else {
Expand All @@ -278,14 +275,6 @@ pub fn main() !void {
std.process.exit(0);
}

if (measure_clock) {
const now = spice.clock.read();
std.time.sleep(1 * std.time.ns_per_ms);
const dur = spice.clock.read() - now;
std.debug.print("1 ms = {} ticks\n", .{dur});
std.debug.print("1 µs = {} ticks\n", .{dur / 1000});
}

if (n == null) {
failArgs("-n is required.", .{});
}
Expand Down
40 changes: 0 additions & 40 deletions src/clock.zig

This file was deleted.

2 changes: 0 additions & 2 deletions src/root.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const std = @import("std");

pub const clock = @import("clock.zig").default;

pub const ThreadPoolConfig = struct {
/// The number of background workers. If `null` this chooses a sensible
/// default based on your system (i.e. number of cores).
Expand Down

0 comments on commit aa56de3

Please sign in to comment.