How about you create a priority queue of sorts?
(Note that the following is a fake priority queue, it is O(n), while a sorted queue should have a much lower runtime cost)
Code:
class TimerQueue
{
static class Pair
{
Runnable runnable;
long timeWhenToRunTask;
}
Vector<Pair> myTasks;
public void schedule(Runnable task, long timeTillTask)
{
myTasks.addElement( new Pair(task,timeTillTask + System.currentTimeInMillisecs() ));
}
public void update()
{
for (int i = 0; i < myTasks.size(); i++)
{
Pair p = myTasks.get(i);
if (p.timeWhenToRunTask < System.currentTimeInMillisecs() )
{
p.task.run();
myTasks.remove(i);
i--;
}
}
}
}
Warning: Unstested code, use at own risk
Then you could simply schedule tasks and they will run after the certain time has passed, assuming you call update every "tick".
I know threading can do the same things, but I do not trust neither myself nor the cRIO with threading.