*-------------------------------------------------------------------------- procedure cov() =Coverage('\tmp\log.log') endproc *-------------------------------------------------------------------------- procedure Coverage(_file) local coverageFile coverageFile = 'coverage' Create cursor (coverageFile) ; ( duration n(7,3), ; class c(30), ; procedure c(60), ; line i, ; file c(100) ; ) APPEND FROM (_file) TYPE DELIMITED go top delete select procedure, ; Class, ; line, ; count(*) as TimesCalled , ; sum(Duration) as TotalTime ; from (CoverageFile) ; into cursor Statistics ; group by 1, 2, 3 ; union all ; select '', ; '', ; 0, ; 1, ; sum(Duration) ; from (CoverageFile) select *, ; TotalTime/TimesCalled as Average ; from Statistics ; into Cursor Summary select * ; from Summary ; into Cursor TimesCalled ; order by TimesCalled Desc go top brow select * ; from Summary ; into Cursor TotalTime ; order by TotalTime Desc go top brow endproc