forked from Hyperion/HyperionOS
working on require needs to be done before EOW
This commit is contained in:
23
src/disks/45h/bin_/top
Normal file
23
src/disks/45h/bin_/top
Normal file
@@ -0,0 +1,23 @@
|
||||
local hpv=require("hypervisor")
|
||||
local term=component.getFirst("screen")
|
||||
|
||||
term.clear()
|
||||
local function m(str, m)
|
||||
if #str>m then
|
||||
return str:sub(1,m-1).."- "
|
||||
else
|
||||
while #str~=m do
|
||||
str=str.." "
|
||||
end
|
||||
return str.." "
|
||||
end
|
||||
end
|
||||
|
||||
for i in hpv.listProc() do
|
||||
term.print(m(i.name, 15)..m(i.status, 7)..m(i.pid, 4))
|
||||
for _,v in ipairs(i.threads) do
|
||||
if v.name~="main" then
|
||||
term.print(" "..m(v.name, 12)..m(v.status, 7))
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user