mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-23 22:14:20 +02:00
Retrieve gettimeofday() from sys/time.h
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
parent
61f3fadfbf
commit
d40ec873a7
4 changed files with 16 additions and 12 deletions
|
|
@ -102,8 +102,8 @@ const E = [_]u21{
|
|||
pub fn clockCell(animate: bool, char: u8, fg: u16, bg: u16) [SIZE]termbox.tb_cell {
|
||||
var cells: [SIZE]termbox.tb_cell = undefined;
|
||||
|
||||
var tv: std.c.timeval = undefined;
|
||||
_ = std.c.gettimeofday(&tv, null);
|
||||
var tv: interop.system_time.timeval = undefined;
|
||||
_ = interop.system_time.gettimeofday(&tv, null);
|
||||
|
||||
const clock_chars = toBigNumber(if (animate and char == ':' and @divTrunc(tv.tv_usec, 500000) != 0) ' ' else char);
|
||||
for (0..cells.len) |i| cells[i] = utils.initCell(clock_chars[i], fg, bg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue