i5-8500 is fine, but you should look at turbo boost not base frequency since the CPU doesn't really run at base frequency but turbo boost when in use. 4.0GHz vs 4.1GHz is the difference in turbo boost speed. The price difference, while only $10 diff is more than the 3% difference in speed.
Also, the B360 mobo will only support up to DDR4 2666MHz memory. You must get a Z370 mobo if you want to run faster memory with the Intel CPU. Kind of a trade off but either way the i5 will be faster than the Ryzen 5 1600 in gaming.