Added max time support to profiler and exposed it to JS