TIME(9)
π time(9) β HAL Component π
okay bestie, listen up. this is time from the HAL Component section 9 of the manual, and honestly? it's giving clock energy. it counts time in hours, minutes and seconds so your machine can be cute and punctual. let's get into it πβ¨
β¨ NAME β¨
time β Time on in Hours, Minutes, Seconds
like, it's a timer. it times things. the vibes are immaculate. β±οΈ
πΈ SYNOPSIS πΈ
loadrt time [count=N|names=name1[,name2...]]
yes that's the whole thing. load the realtime component, optionally with count=N or names=name1[,name2...]. slay. π
π¦ DESCRIPTION π¦
Time
okay so here's the whole plot. when either the time.N.start or time.N.pause bit goes true, the cycle timer resets and starts to time β and it keeps going until time.N.start AND time.N.pause both go false. π
when the time.N.pause bit goes true, timing is paused until time.N.pause goes false. that's it. that's the pause.
β οΈ but bestie, listen, this next bit matters: if you connecttime.N.starttohalui.program.is-runningand leavetime.N.pauseunconnected, the timer will reset during a pause. it's giving chaotic. the example connections below explain it better, so keep reading π«Ά
Time returns the hours, minutes, and seconds that time.N.start is true.
here's some sample PyVCP code to display the hours:minutes:seconds. it's very cunty actually:
<pyvcp>
<hbox>
<label>
<text>"Cycle Time"</text>
<font>("Helvetica",14)</font>
</label>
<u32>
<halpin>"time-hours"</halpin>
<font>("Helvetica",14)</font>
<format>"2d"</format>
</u32>
<label>
<text>":"</text>
<font>("Helvetica",14)</font>
</label>
<u32>
<halpin>"time-minutes"</halpin>
<font>("Helvetica",14)</font>
<format>"2d"</format>
</u32>
<label>
<text>":"</text>
<font>("Helvetica",14)</font>
</label>
<u32>
<halpin>"time-seconds"</halpin>
<font>("Helvetica",14)</font>
<format>"2d"</format>
</u32>
</hbox> </pyvcp>
then, in your post-gui.hal file, you might use one of the following to connect this timer. pick your fighter π₯
for a new config:
loadrt time
addf time.0 servo-thread
net cycle-timer time.0.start <= halui.program.is-running
net cycle-timer-pause time.0.pause <= halui.program.is-paused
net cycle-seconds pyvcp.time-seconds <= time.0.seconds
net cycle-minutes pyvcp.time-minutes <= time.0.minutes
net cycle-hours pyvcp.time-hours <= time.0.hours
if you're on an older setup β pookie, previous to this version, if you wanted the timer to keep running during a pause instead of resetting, you had to use a HAL NOT component to invert the halui.program.is-idle pin and connect it to time.N.start, like this:
loadrt time
loadrt not
addf time.0 servo-thread
addf not.0 servo-thread
net prog-running not.0.in <= halui.program.is-idle
net cycle-timer time.0.start <= not.0.out
net cycle-seconds pyvcp.time-seconds <= time.0.seconds
net cycle-minutes pyvcp.time-minutes <= time.0.minutes
net cycle-hours pyvcp.time-hours <= time.0.hours
and for those of you who already have this setup, you can simply add a net connecting time.N.pause to halui.program.is-paused:
net cycle-timer-pause time.0.pause <= halui.program.is-paused
easy upgrade, no notes. π
π₯ FUNCTIONS π₯
time.N(requires a floating-point thread) β yes it needs a float thread, don't fight it. it's a main character with standards. π
π PINS π
time.N.startbitinβ Timer Ontime.N.pausebitin(default:0) β Pausetime.N.secondsu32outβ Secondstime.N.minutesu32outβ Minutestime.N.hoursu32outβ Hours
that's the whole pin lineup, no cap. the bit ones go in, the u32 ones come out, and time.N.pause starts at 0 like a good lil default. β¨
π AUTHOR π
John Thornton, itaib, Moses McKnight
legends, honestly. periodt. π
π LICENSE π
GPL
so yeah! that's time(9), documented by the LinuxCNC Documentation crew, dated 2026-03-17. go forth and time your cycles, bestie β i'm obsessed with you understanding this now. mwah ππΈβ¨
π¦ where this page comes from
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms