Rising cancer incidences, complex treatment techniques, and workflows have all impacted the radiotherapy scheduling process. Intelligent appointment scheduling is needed to help radiotherapy users adapt to new practices. We utilized van Herk's safety margin formula to determine the radiotherapy department's treatment scheduling window (TSW). In addition, we examined the influence of in-room imaging on linac occupancy time (LOT). Varian Aria™ software version 15.1 was used to collect retrospective data on LOT, treatment site, intent, techniques, special protocol, and in-room imaging. Treatment scheduling windows varied across treatment sites. The mean TSW using van Herk's formalism was 31.5 min, significantly longer than the current TSW of 15 min (P = 0.036), with the pelvic site having the longest (43.8 min) and the brain site having the shortest (12 min). 28% of patients exceeded the in-practice TSW of 15 min. 46.2% of patients had multiple images per fraction, with the proportion being highest in pelvic patients (33%). Patients treated with palliative intent, intensity-modulated radiotherapy, special protocols (bladder protocol and gating), and multiple in-room images per fraction had significantly higher LOT. High treatment time uncertainty was observed in the pelvic and thorax sites, indicating the impact of in-room imaging frequency and on-couch treatment decisions on overall treatment time and indicating that current treatment practices should be reviewed and modified if necessary. The time margin recipe can customize the treatment scheduling window and improve treatment practices. This formalism can help manage the radiotherapy department's workload and reduce patient wait times.