added automatic query timing; updated connect example