webmcp
diff framework/env/trace/exectime.lua @ 0:9fdfb27f8e67
Version 1.0.0
author | jbe/bsw |
---|---|
date | Sun Oct 25 12:00:00 2009 +0100 (2009-10-25) |
parents | |
children | 0bbfee4d4aed |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/framework/env/trace/exectime.lua Sun Oct 25 12:00:00 2009 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 +--[[-- 1.5 +trace.exectime{ 1.6 + real = real, -- physical time in seconds 1.7 + cpu = cpu -- CPU time in seconds 1.8 +} 1.9 + 1.10 +This function is called automatically to log the execution time of the handling of a request. 1.11 + 1.12 +--]]-- 1.13 + 1.14 +function trace.exectime(args) 1.15 + local real = args.real 1.16 + local cpu = args.cpu 1.17 + if type(real) ~= "number" then 1.18 + error("Called trace.exectime{...} without numeric 'real' argument.") 1.19 + end 1.20 + if type(cpu) ~= "number" then 1.21 + error("Called trace.exectime{...} without numeric 'cpu' argument.") 1.22 + end 1.23 + trace._new_entry{ type = "exectime", real = args.real, cpu = args.cpu } 1.24 +end