You could also use the sleep(long) method instead of yours.
long interim=1000;
public void live() {
new Thread()
{
public void run()
{
while (true)
{
doA();
doB();
try
{
sleep(interim);
} catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
}.start();
}