Posted to tcl by dkf at Thu Oct 17 19:48:37 GMT 2013view raw

  1. proc Elapse {startMilliseconds} {
  2. set nmsecs [expr {[clock milliseconds] - $startMilliseconds}]
  3. return [format %.03f [expr {$nmsecs/1000.0}]]
  4. }
  5.  
  6. apply {{} {
  7. set start [clock milliseconds]
  8. set fd [open dump.log]
  9. while {[gets $fd line] != -1} {
  10. if {[expr {[incr nlines] % 100000}] == 0} {
  11. puts "$nlines lines, [Elapse $start] seconds passed"
  12. }
  13. }
  14. puts "$nlines lines, [Elapse $start] seconds passed"
  15. }}