You could consider including an interaction between resident presence and operative time as an additional predictor in the model.
Say resident presence ($R$) is coded as 0 for No and 1 for Yes, and operative time ($T$) is expressed in minutes. Logistic regression is for absence/presence (0/1) of postoperative complications. Then the linear predictor for log-odds of complications would take the form:
$$\beta_0 + \beta_1 R + \beta_2 T + \beta_3 RT.$$
Here, $\beta_0$ is the hypothetical log-odds of complication without a resident for a 0-minute operation, $\beta_1$ is the additional contribution of resident presence for a 0-minute operation,* $\beta_2$ is the extra contribution per minute without a resident, and $\beta_3$ is how much more each minute matters when a resident is present.
You should include covariates in your model to handle other factors associated with complication rate (age, patient performance status, inherent surgery complexity), as omitting any predictor associated with outcome can lead to bias in logistic regression. You might need to consider interactions of such covariates with resident presence, too. That will require a large study, as to avoid overfitting you should have on the order of 15 cases with complications** per predictor that you are evaluating. So with resident presence, operative time, their interaction, and just 1 composite measure of other risks (without an interaction) you need about 60 cases with complications.
Even then, your model might not be adequate. For example, my experience in teaching hospitals suggests that some attending surgeons (with their individual sub-specializations and complication rates) are more likely to attract (or to welcome) residents to their operations than others, so you probably should take that into account too. I'd recommend close consultation with a local biomedical statistician to help work these issues through, particularly if you want to publish your results in a reputable journal.
*You could choose to use a different reference time to make interpretation of $\beta_0$ and $\beta_1$ more transparent, say subtracting 60 minutes from all time values so that these coefficients represent the baseline complication log-odds and the additional contribution of the resident for a one-hour operation. $\beta_2$ and $\beta_3$ would stay the same, as would any particular predictions for combinations of resident presence and operative time.
**I'm assuming that a minority of cases have complications. The rule of thumb for biomedical logistic regression studies is 15 minority-class cases per predictor.