Rise difficulty in code, still no changes after rebuild
What am I doing wrong?


Not setting the difficulty high enough. A standard computer can do 1 MH/s SHA256d hashes, or about 2^20 hashes. That means in your scenario, solving a regtest block will take about 1 second. If you want it to take longer, increase the difficulty.

Also, note that if you're using an 0.9.* version of bitcoin, then setting the regtest difficulty to below ~uint256(0) &gt;&gt; 16 won't really do much, as the mining code won't even check a result that doesn't hash to below that difficulty.

If you're using the most recent code, though, then rather than adjusting the regtest parameters, you could also just add your own set of parameters.