Observable<Long> ob=timer.setPeriodic(50).take(3);
final long startTime=System.currentTimeMillis();
// Expect 3 values
final Subscription sub=assertCountThen(ob,new Action0() {
public void call() {
long totalTime=System.currentTimeMillis()-startTime;
System.out.println("Test complete after "+(totalTime)+"ms");
// Ensure the total time is withing 20% of the expected value
assertTrue("Time within 20% of expected",Math.abs((totalTime/(50*3))-1)<0.2);