Which preposition is correct and what is the difference in meaning if any?

> I went to the gym, something I haven't done **for** a long time.
> 
> I went to the gym, something I haven't done **in** a long time.