SRL Archive - Help

Checking Markt


Element17

2012-07-16 12:15:45

Is there anyway to check the time that has passed from when you call MarkTime?

Runaway

2012-07-16 12:16:41

MarkTime(t);
TimeFromMark(t);

:)

Element17

2012-07-16 12:40:51

Silly! I know that haha, but I'm looking for a timer….hope I can explains this so it makes sense.


Okay.

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 box

Does that make sense? I just want to mark the time and after it does whatever procedures/functions I want to see how much time has passed since I marked the time.

Home

2012-07-16 12:46:31

Like he said..

MarkTime(C);
Do...
This..
Stuff..
WriteLn(TimeFromMark(C));

~Home

Abu

2012-07-16 12:49:38

^^^ Wouldn't you have to do IntToStr() ?

Runaway

2012-07-16 12:50:52

From: abu_jwka
^^^ Wouldn't you have to do IntToStr() ?


Nope ;) Only when you're mixing strings with integers(/variants).

Abu

2012-07-16 13:00:20

From: Runaway
Nope ;) Only when you're mixing strings with integers(/variants).


But isn't TimeFromMark(C) an integer and doesn't Writeln() require a string?

Is that not mixing? :confused:

Runaway

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:


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.

Abu

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.


Ah, alright. I get it now ;)

See I usually do Writeln('Time: '+TimeFromMark(t));, which explains a lot.

Element17

2012-07-16 16:24:45

Ahh thank you Runaway..you seem to always be helping me haha. Also thanks Home. For some reason I thought it would of been more difficult.

P1ng

2012-07-16 18:49:29

I use this function which I slightly modified from a code that runaway posted when I asked a similar question a little while back -
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;

used like this in my script
    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));

Feel free to edit this as you wish to suit your purposes if you'd like, it just writes the time remaining in your status bar

Element17

2012-07-16 20:05:15

Thanks mate!