# File lib/facter/util/resolution.rb, line 153
153:   def value
154:     result = nil
155:     return result if @code == nil
156: 
157:     starttime = Time.now.to_f
158: 
159:     begin
160:       Timeout.timeout(limit) do
161:         if @code.is_a?(Proc)
162:           result = @code.call()
163:         else
164:           result = Facter::Util::Resolution.exec(@code)
165:         end
166:       end
167:     rescue Timeout::Error => detail
168:       warn "Timed out seeking value for %s" % self.name
169: 
170:       # This call avoids zombies -- basically, create a thread that will
171:       # dezombify all of the child processes that we're ignoring because
172:       # of the timeout.
173:       Thread.new { Process.waitall }
174:       return nil
175:     rescue => details
176:       warn "Could not retrieve %s: %s" % [self.name, details]
177:       return nil
178:     end
179: 
180:     finishtime = Time.now.to_f
181:     ms = (finishtime - starttime) * 1000
182:     Facter.show_time "#{self.name}: #{"%.2f" % ms}ms"
183: 
184:     return nil if result == ""
185:     return result
186:   end