Use code replacement for PIL profiling timer function

Starting from R2014a upwards