When 'spend time/money' is followed by the -ing form of a verb (doing), I'd say I would not use a preposition at all in most cases:
- I spent a lot of time comparing prices and features before I finally bought my new car. - He didn't spend much time studying before he took his final. - They spent hours looking for the ring.