From d7680498e1c55025577eb23204e3a2cbd81952d3 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Fri, 26 Jul 2024 11:41:19 +0300 Subject: Don't care about receive time --- src/main.zig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 0c524a7..3c75f25 100644 --- a/src/main.zig +++ b/src/main.zig @@ -309,11 +309,9 @@ fn onTextCommand(bot: *Bot, msg: types.Message, text: []const u8, cmd: []const u } else if (std.mem.eql(u8, simple_cmd, "ping")) { var timer = try std.time.Timer.start(); - const recv = msg.date - @as(u64, @intCast(std.time.timestamp())); - var sb = ArrayList(u8).init(bot.allocator); defer sb.deinit(); - try sb.writer().print("Pong!\nReceive time: {}s\nSend time: ...", .{recv}); + try sb.writer().print("Pong!\nSend time: ...", .{}); const reply = try bot.sendMessage(.{ .chat_id = msg.chat.id, @@ -327,7 +325,7 @@ fn onTextCommand(bot: *Bot, msg: types.Message, text: []const u8, cmd: []const u const send = @as(f64, @floatFromInt(timer.read())) / std.time.ns_per_ms; sb.clearRetainingCapacity(); - try sb.writer().print("Pong!\nReceive time: {}s\nSend time: {d}ms", .{ recv, send }); + try sb.writer().print("Pong!\n\nSend time: {d}ms", .{send}); try bot.editMessageText_(.{ .chat_id = reply.value.chat.id, -- cgit v1.2.3