# File lib/facter/util/resolution.rb, line 224
224:   def value
225:     result = nil
226:     return result if @code == nil
227: 
228:     starttime = Time.now.to_f
229: 
230:     begin
231:       Timeout.timeout(limit) do
232:         if @code.is_a?(Proc)
233:           result = @code.call()
234:         else
235:           result = Facter::Util::Resolution.exec(@code)
236:         end
237:       end
238:     rescue Timeout::Error => detail
239:       warn "Timed out seeking value for %s" % self.name
240: 
241:       # This call avoids zombies -- basically, create a thread that will
242:       # dezombify all of the child processes that we're ignoring because
243:       # of the timeout.
244:       Thread.new { Process.waitall }
245:       return nil
246:     rescue => details
247:       warn "Could not retrieve %s: %s" % [self.name, details]
248:       return nil
249:     end
250: 
251:     finishtime = Time.now.to_f
252:     ms = (finishtime - starttime) * 1000
253:     Facter.show_time "#{self.name}: #{"%.2f" % ms}ms"
254: 
255:     return nil if result == ""
256:     return result
257:   end