Midterm results seemed to be determined within hours of polls closing. California had dozens of county and statewide referendums which need to be hand counted, so there's was delayed. Alaska and one other state do rank choice, which adds weeks to the count. I believe the Georgia runoff was final before midnight. When adequate polling locations and staff is available, the counts come in pretty quickly. The sites I oversee had our results submitted by 9pm and certified by 10pm.