i'm trying to run different widgets at different times however this sleep script is sleeping first then executing all the widgets instead of executing a widget then sleeping and so on.
function sleep(ms)
{
var dt = new Date();
dt.setTime(dt.getTime() + ms);
while (new Date().getTime() < dt.getTime());
}
function grab1() {
widgetSetString('A', '1500');
widgetSetString('B', '400');
sleep(4000);
widgetSetString('C', '1250');
widgetSetString('D', '1950');
widgetSetString('E', '300');
sleep(1000);
widgetSetString('A', '1275');
}
What is wrong???