32: def print_profile(f)
33: stop_profile
34: total = Process.times[0] - @@start
35: if total == 0 then total = 0.01 end
36: data = @@map.values
37: data.sort!{|a,b| b[2] <=> a[2]}
38: sum = 0
39: f.printf " %% cumulative self self total\n"
40: f.printf " time seconds seconds calls ms/call ms/call name\n"
41: for d in data
42: sum += d[2]
43: f.printf "%6.2f %8.2f %8.2f %8d ", d[2]/total*100, sum, d[2], d[0]
44: f.printf "%8.2f %8.2f %s\n", d[2]*1000/d[0], d[1]*1000/d[0], get_name(*d[3])
45: end
46: f.printf "%6.2f %8.2f %8.2f %8d ", 0.0, total, 0.0, 1
47: f.printf "%8.2f %8.2f %s\n", 0.0, total*1000, "#toplevel"
48: end