Page 1 of 1

Task 30 minutes before sunset doesn't run

Posted: Sun Feb 21, 2010 6:45 pm
by jhoski
Found this example the forum but the task never runs. I'm using this expresion and testing if Equal to the 'System Time.Time Without Minutes' property.

SUNSET_DATE_AND_TIME - Days=0, Hours=00, Minutes=30, Seconds=00

This evaluates to something that looks like this:

If ('System Time.Time Without Seconds' is Equal '2/21/2010 5:04:00 pm') Then
do stuff...

It has been in place for a couple of days now but does not run.
Suggestions? Jay

Re: Task 30 minutes before sunset doesn't run

Posted: Sun Feb 21, 2010 10:47 pm
by Osler
Use it like this:

Code: Select all

If System Time.TimeAndDate is equal '<the expression defined by SUNSET_DATE_AND_TIME - Days=0, Hours=00, Minutes=30, Seconds=00>' Then
You need to have both the time and date present for it to evaluate. Hence, System Time.TimeWithoutSeconds won't get you what you want.

Osler

Re: Task 30 minutes before sunset doesn't run

Posted: Mon Feb 22, 2010 7:01 pm
by jhoski
Thanks, its working now.

The original post where I saw this mentioned that using a condition with seconds causes a lot of overhead checking. Do I need to be concerned? The machine I'm using is not very strong. Single processor AMD @ 995Mhz.

Re: Task 30 minutes before sunset doesn't run

Posted: Mon Feb 22, 2010 7:16 pm
by Osler
It'll be fine. After being used to nested if/then functions, you will find that the very simple logic in tasks to sometimes stump you as to why it isn't working or why it is working the way that it is.

Osler

Re: Task 30 minutes before sunset doesn't run

Posted: Tue Feb 23, 2010 12:41 am
by Richard Naninck
I got about 50 scripts always running using a Do Loop.
The Loop checks the state of a property every milisecond.
So imagine i have about 50 state checks (GetpropertyValue) every ms and it doesn't cost a single cpu percentage.

So no worries about a 1 second check :D