calculating theta and processing delay