Recently, anyway. Look at the Lincoln assassination co-conspirators. Lincoln was killed in mid-April 1865, and they were all hung on July 7, 1865.
The phenomenon of it taking over a decade to execute a condemned prisoner only started in like the mid-20th century.
The long time from conviction and sentencing to actual execution greatly diminishes the deterrence value of capital punishment.
His assassin Leon Czolgosz was executed before Halloween same year.