I am trying to print some data at the end of the day using the "after" command but it doesn't seem to be working. Instead of just printing one line at end of day it prints several lines. There is another procedure which i haven't included where the taccepts, trequests and terrors get incremented. Can anyone point out where i am going wrong. Thanks in advance.
proc printReport {} {
global taccepts
global trequests
global terrors
puts "Accepts: $taccepts, Requests: $trequests, Errors: $terrors"
set taccepts 0
set trequests 0
set terrors 0
after [expr [expr [clock scan "today 23:59:59"] - [clock seconds]] * 1000] printReport
}
set taccepts 0
set trequests 0
set terrors 0
printReport
proc printReport {} {
global taccepts
global trequests
global terrors
puts "Accepts: $taccepts, Requests: $trequests, Errors: $terrors"
set taccepts 0
set trequests 0
set terrors 0
after [expr [expr [clock scan "today 23:59:59"] - [clock seconds]] * 1000] printReport
}
set taccepts 0
set trequests 0
set terrors 0
printReport