Janilabo

GetSystemTime "timer" example 2

Mar 30th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.45 KB | None | 0 0
  1. const
  2.   REPORT_EVERY = 1000;
  3.  
  4. var
  5.   t, d, s: Integer;
  6.  
  7. procedure StatusReport;
  8. begin
  9.   Inc(s);
  10.   Status(TimeToStr(Now) + ': Time for status report nr.' + IntToStr(s) + '!');
  11. end;
  12.  
  13. begin
  14.   repeat                    
  15.     Inc(d);
  16.     while ((GetSystemTime - t) < REPORT_EVERY) do    
  17.       StatusReport;
  18.     WriteLn(TimeToStr(Now) + ': Time for debug report nr.' + IntToStr(d) + '!');
  19.     t := GetSystemTime;    
  20.   until False;
  21. end.
Advertisement
Add Comment
Please, Sign In to add comment