summaryrefslogtreecommitdiff
path: root/static/inferno/man10/seconds.10
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/inferno/man10/seconds.10
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/inferno/man10/seconds.10')
-rw-r--r--static/inferno/man10/seconds.1064
1 files changed, 64 insertions, 0 deletions
diff --git a/static/inferno/man10/seconds.10 b/static/inferno/man10/seconds.10
new file mode 100644
index 00000000..aeec3268
--- /dev/null
+++ b/static/inferno/man10/seconds.10
@@ -0,0 +1,64 @@
+.TH SECONDS 10.2
+.SH NAME
+seconds, ticks, HZ, MS2HZ, MS2TK, TK2MS, TK2SEC \- kernel times and time conversions
+.SH SYNOPSIS
+.ta \w'\fL#define 'u
+.B
+long seconds(void)
+.PP
+.B
+ulong ticks(void)
+.PP
+.EX
+#define HZ ...
+#define MS2HZ(t) ...
+#define TK2SEC(t) ...
+#define TK2MS(t) ...
+#define MS2TK(m) ...
+.EE
+.SH DESCRIPTION
+.I Seconds
+returns the system's idea of the current time as the number of seconds
+since the start of the epoch
+(00:00:00 GMT, January 1, 1970).
+.PP
+.I Ticks
+returns the number of system-dependent clock ticks since system boot.
+.PP
+The system clock frequency is platform-dependent.
+Several symbolic constants and macro functions are defined by
+the file
+.B mem.h
+to convert between different time units:
+.TF TK2SEC(t)
+.PD
+.TP
+.B HZ
+The number of clock ticks per second.
+.TP
+.B MS2HZ
+Milliseconds per clock tick.
+.TP
+.BI TK2SEC( t )
+Convert
+.I t
+clock ticks to seconds and return the result (truncating not rounding).
+.TP
+.BI TK2MS( t )
+Convert
+.I t
+clock ticks to milliseconds and return the result.
+.TP
+.BI MS2TK( m )
+Convert
+.I m
+milliseconds to clock ticks and return the result (truncating).
+.PP
+The functions are often used to calculate delays for timing functions,
+for instance:
+.IP
+.EX
+if(atactlrwait(dp->cp, DHmagic, 0, MS2TK(100))){
+ ...
+}
+.EE