Added setLatency