From 05c1076ba2d1a68fe7f3a5ae618f786b8898d327 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 26 Sep 2005 18:32:28 +1000 Subject: Initial import. --- src/bltin/times.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/bltin/times.c (limited to 'src/bltin/times.c') diff --git a/src/bltin/times.c b/src/bltin/times.c new file mode 100644 index 0000000..d8a35dc --- /dev/null +++ b/src/bltin/times.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1999 Herbert Xu + * This file contains code for the times builtin. + * $Id$ + */ + +#include +#include +#ifdef USE_GLIBC_STDIO +#include +#else +#include "bltin.h" +#endif + +#define main timescmd + +int main() { + struct tms buf; + long int clk_tck = sysconf(_SC_CLK_TCK); + + times(&buf); + printf("%dm%fs %dm%fs\n%dm%fs %dm%fs\n", + (int) (buf.tms_utime / clk_tck / 60), + ((double) buf.tms_utime) / clk_tck, + (int) (buf.tms_stime / clk_tck / 60), + ((double) buf.tms_stime) / clk_tck, + (int) (buf.tms_cutime / clk_tck / 60), + ((double) buf.tms_cutime) / clk_tck, + (int) (buf.tms_cstime / clk_tck / 60), + ((double) buf.tms_cstime) / clk_tck); + return 0; +} -- cgit 1.4.1 t/log.c?h=catgirl&follow=1'>commit diff
Commit message (Collapse)Author
2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe
2022-02-12Copy RPP defines from oconfigureJune McEnroe