| 发表于:2007-06-19 15:37:193楼 得分:0 |
public static string timespan; public static datetime dt1, dt2, dt3; public static int i = 0; //提交的次数 private void checkedtime() { if (!ispostback) { dt1 = datetime.now; } else { if (i == 0) { dt2 = datetime.now; timespan = ((timespan)(dt2 - dt1)).hours.tostring() + ": " + ((timespan)(dt2 - dt1)).minutes.tostring() + ": " + ((timespan)(dt2 - dt1)).seconds.tostring(); } else { dt3 = dt2; dt2 = datetime.now; timespan = ((timespan)(dt2 - dt3)).hours.tostring() + ": " + ((timespan)(dt2 - dt3)).minutes.tostring() + ": " + ((timespan)(dt2 - dt3)).seconds.tostring(); } i++; } | | |
|