home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Find out how long something takes...
- **
- */
-
- parse arg cmd
-
- file = stdout
- writeln( file, '' )
- writeln( file, '** Timing, starting at' date( s ) time( ) )
- writeln( file, '' )
- writeln( file, ' /~~~' cmd )
- writeln( file, '' )
-
- begin_date = date( i )
- begin_time = time( s )
- address command cmd
- end_date = date( i )
- end_time = time( s )
-
-
- run_seconds = end_time - begin_time
- run_days = end_date - begin_date
-
- run_hours = run_seconds % 3600
- run_seconds = run_seconds // 3600
- run_minutes = run_seconds % 60
- run_seconds = run_seconds // 60
-
- if length( run_days ) < 2 then run_days = right( run_days, 4 )
- run_hours = right( run_hours, 2, 0 )
- run_minutes = right( run_minutes, 2, 0 )
- run_seconds = right( run_seconds, 2, 0 )
-
- writeln( file, '' )
- writeln( file, ' \___' cmd )
- writeln( file, '' )
- writeln( file, ' days hh:mm:ss' )
- writeln( file, ' 'run_days run_hours':'run_minutes':'run_seconds )
- writeln( file, '' )
- writeln( file, '---tear line!' )
- writeln( file, '' )
-
-