const std = @import("std"); pub const io_mode = .evented; pub fn main() anyerror!void { var first_half = async addSomeNumbersTogether(0, 1000000); var second_half = async addSomeNumbersTogether(1000000, 2000000); const total = await first_half + await second_half; std.debug.warn("total: {}\n", .{total}); } fn addSomeNumbersTogether(start: u64, end: u64) u64 { std.event.Loop.startCpuBoundOperation(); var sum: u64 = 0; var i: u64 = start; while (i < end) : (i += 1) { sum += i; } return sum; }