#require 'profile'
require 'html_ssi_lua'
x = 100
startt0 = Time.now
ar = {'car'=>'Jaguar','color'=>'red'}
fget_file = proc {|ftype,fname| f = File.open(fname); fc = f.read; f.close(); fc}
f = File.open('test_ssi_lua_2.html')
fc = f.read
f.close()
vunknown = 'unknown'
fget_var = proc {|vname| vunknown}
(1..x).each do |xx|
startt = Time.now
ssi = HTMLSSI.new
ssi.set_var('ar',ar)
ssi.fget_var = fget_var
ssi.fget_include = fget_file
#print ssi.li.call('__loopFunc',5555,fc)
ssi.parse(fc)
print ssi.get_results
print "\n\n#{xx} Used time = #{Time.now - startt}"
end
finalt = Time.now - startt0
average = finalt/x
print "\n\nUsed time for #{x} = #{finalt} average = #{average}"