Make measure decorator configurable
Add test for the measure decorator