aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2026-04-12 11:49:29 +0100
committerRon Yorston <rmy@pobox.com>2026-04-12 11:49:29 +0100
commit333c65ca71f1acb2cc6cd3920a346bb8ddf82dec (patch)
treef4f8b1f07358949579a08a8ae084a57a12e22506 /include
parent4e7a8bfc75b129b3a671229544f9e5c4168daabf (diff)
downloadbusybox-w32-333c65ca71f1acb2cc6cd3920a346bb8ddf82dec.tar.gz
busybox-w32-333c65ca71f1acb2cc6cd3920a346bb8ddf82dec.tar.bz2
busybox-w32-333c65ca71f1acb2cc6cd3920a346bb8ddf82dec.zip
ash: allow 'times' built-in to report process timing
Move existing code which obtains process execution times into a separate function. Use it to allow times(2) to report execution times for the current process, though not child execution times. Change TICKS_PER_SECOND from 100 to 1000 to increase the displayed resolution of process times (though the measured resolution may well be less than this). Adds 48-80 bytes. (GitHub issue #574)
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h3
-rw-r--r--include/mingw.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index ee3a5b56a..a73a04153 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -2435,6 +2435,9 @@ unsigned get_cpu_count(void) FAST_FUNC;
2435unsigned long FAST_FUNC fast_strtoul_10(char **endptr); 2435unsigned long FAST_FUNC fast_strtoul_10(char **endptr);
2436unsigned long long FAST_FUNC fast_strtoull_16(char **endptr); 2436unsigned long long FAST_FUNC fast_strtoull_16(char **endptr);
2437char* FAST_FUNC skip_fields(char *str, int count); 2437char* FAST_FUNC skip_fields(char *str, int count);
2438#if ENABLE_PLATFORM_MINGW32
2439void get_process_times(DWORD pid, procps_status_t* sp);
2440#endif
2438 2441
2439 2442
2440/* Use strict=1 if you process input from untrusted source: 2443/* Use strict=1 if you process input from untrusted source:
diff --git a/include/mingw.h b/include/mingw.h
index a77aa35ac..ac824fd52 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -488,9 +488,9 @@ clock_t times(struct tms *buf);
488 488
489#define _SC_CLK_TCK 2 489#define _SC_CLK_TCK 2
490 490
491#define TICKS_PER_SECOND 100 491#define TICKS_PER_SECOND 1000
492#define MS_PER_TICK 10 492#define MS_PER_TICK 1
493#define HNSEC_PER_TICK 100000 493#define HNSEC_PER_TICK 10000
494 494
495IMPL(alarm,unsigned int,0,unsigned int seconds UNUSED_PARAM); 495IMPL(alarm,unsigned int,0,unsigned int seconds UNUSED_PARAM);
496IMPL(chown,int,0,const char *path UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARAM); 496IMPL(chown,int,0,const char *path UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARAM);