Differences From
Artifact [9f5dd95326]:
129 129 return fn.rng(PcgRandom(self.seed+n):next())
130 130 end;
131 131 __add = function(self, n)
132 132 return fn.seedbank(self.seed + n)
133 133 end;
134 134 }
135 135 -- function fn.vlerp
136 +
137 +function fn.timespec(n)
138 + if n == 0 then return '0s' end
139 + if n < 0 then return '-' .. fn.timespec(n*-1) end
140 +
141 + local sec = n % 60
142 + local hr = math.floor(n / 60)
143 + local spec = {}
144 +
145 + if sec ~= 0 then table.insert(spec, string.format("%ss", sec)) end
146 + if hr ~= 0 then table.insert(spec, string.format("%shr", hr)) end
147 + return table.concat(spec, ' ')
148 +end
136 149 return fn