Also remember that the first time you execute a function you should not @time it because then it also measures the compilation time. You can test this by doing
@time test(m,nbp) @time test(m,nbp) @time test(m,nbp) and probably see that the 2nd and 3rd time the timing is lower than for the first one.
