I have done this in the past to wash off as much capital gain whenever I could, even when the tax laws did not change. If you let the cap gain accumulates, eventually when you need to sell it, the gain may be too much and you have to pay taxes. You cannot "save" the unused tax-free cap gain for later years, so use it all up each year.
I was able to do it only after I stopped work, to be in a sweet spot in the tax bracket. When I start to draw IRA/401k and get SS, will not be able to do this anymore, so the window is small.
I sold and bought back immediately in a matter of seconds. I have enough at my brokerage to get 100 free trades each month, so it does not even cost a dime. That's for stocks and ETFs though. MFs still have some transaction fees, plus cannot be bought and sold like stock day trading.