implement keys-per-minute computing function.