Upvote:1
All that matters to the US is that you leave before your 90 days has expired, with the caveat that going to Canada and returning is not considered "leaving".
For example, if you are in the US for 80 days and then Canada for 7 days, then you have a remaining 3 days (80 + 7 + 3 = 90) to depart the US.
Note that you may depart the US by going to Canada and then going somewhere outside North America from there (and you can stay in Canada for as long as the Canadian officials will let you without reference to your US entry date).