I spent two hours doing my homwork yesterday.
p.s.没有spend to do这种东西
Take这样用:It takes me two hours to do sth.