12-24-2009, 07:57 PM
It worked For me ; pls find the Code below :[/u]
Code:
Function Total_Execution_Time(Start_Time,End_Time)
total number of seconds
TotalTime_Secs = Datediff("s",Start_Time,End_Time)
'convert total Seconds into "Seconds only/ Mins+Secs/ Hrs+Mins+Secs"
If TotalTime_Secs < 60 Then
TotalTime = "Total Time Taken For Complete Execution = " & TotalTime_Secs & " Second(s) Approx."
ElseIf TotalTime_Secs >=60 and TotalTime_Secs < 3600 Then
TotalTime = "Total Time Taken For Complete Execution = " & int(TotalTime_Secs/60) & " Minute(s) and "& TotalTime_Secs Mod 60 & " Second(s) Approx."
ElseIf TotalTime_Secs >= 3600 Then
TotalTime = "Total Time Taken For Complete Execution = " & int(TotalTime_Secs/3600) & " Hour(s) , " & int((TotalTime_Secs Mod 3600)/60) & " Minute(s) and "& ((TotalTime_Secs Mod 3600 ) Mod 60) & " Second(s) Approx."
End If
'Return the Message
Total_Execution_Time = TotalTime
End Function