indexing description: "deferred benchmark case. " library: "elogger" copyright: "Copyright (c) 2006, AXA Rosenberg, and others (see copyright.txt)" author: "Ulrich Weiss, and others" license: "Eiffel Forum License v2 (see forum.txt)" date: "$Date: $" revision: "$Revision: $" archive: "$Archive: $" deferred class ELOG_BENCHMARK_CASE inherit DT_SHARED_SYSTEM_CLOCK export {NONE} all end feature -- Access run is -- run deferred end feature {NONE} -- Implementation start is -- start the timer do started := system_clock.time_now end stop is -- stop the timer do stopped := system_clock.time_now end started: DT_TIME -- the time we started stopped: DT_TIME -- the time we started milliseconds: INTEGER_64 is -- time passed since stop-start require started: started /= Void stopped: stopped /= Void local diff: DT_TIME_DURATION do diff := stopped - started Result := diff.minute*60000 + diff.second*1000 + diff.millisecond end iterations_per_second: REAL_64 is -- nr of iterations per second do Result := ((iterations / milliseconds) * 1000) end cycles: INTEGER_64 is -- nr of cycles (set cycles_per_second first) do Result := milliseconds * cycles_per_millisecond end cycles_per_iteration: INTEGER is -- cycles_per_iteration do Result := (cycles / iterations).rounded end cycles_per_millisecond: INTEGER_64 is 2_190_000 -- cycles_per_millisecond on this machine in kHerz. iterations: INTEGER_64 is -- nr of iterations deferred end end