The type III flagellar export specificity switch is dependent on FliK ruler and a molecular clock.