Element17
2012-07-16 12:15:45
Is there anyway to check the time that has passed from when you call MarkTime?
2012-07-16 12:15:45
2012-07-16 12:16:41
2012-07-16 12:40:51
MarkTime(Timer);
//Blah blah blah
//more stuff etc
//Want to check the time that has passed up until this point and post it in the debug box2012-07-16 12:46:31
MarkTime(C);
Do...
This..
Stuff..
WriteLn(TimeFromMark(C));2012-07-16 12:49:38
2012-07-16 12:50:52
From: abu_jwka
^^^ Wouldn't you have to do IntToStr() ?
2012-07-16 13:00:20
From: Runaway
Nope ;) Only when you're mixing strings with integers(/variants).
2012-07-16 13:05:20
From: abu_jwka
But isn't TimeFromMark(C) an integer and doesn't Writeln() require a string?
Is that not mixing? :confused:
2012-07-16 13:06:53
From: Runaway
Mixing:
Writeln('Time: '+TimeFromMark(t));
Writeln actually doesn't require a string, only when more than 1 type of variable is being used. As long as you ask it to write a single variable, it will accept any variant.
2012-07-16 16:24:45
2012-07-16 18:49:29
procedure TimeStamp(WaitTime: Integer);
var
T: Integer;
Ticker: String;
begin
MarkTime(T);
while (WaitTime > TimeFromMark(T)) do
begin
Wait(500);
Ticker := MsToTime(WaitTime - TimeFromMark(T), Time_Short);
Status('Break remaining: ' + Ticker);
end;
end; BreakLength := RandomRange(30000,1200000);//how long the break is
WriteLn('Taking a break for ' + (MsToTime(BreakLength, Time_Short)));
MarkTime(BreakT);//my time mark for the break so to speak
TimeStamp(BreakLength);//Write TimeStamp with the time to countdown in the brackets
repeat
Wait(100);
until (BreakLength < TimeFromMark(BreakT));2012-07-16 20:05:15