12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061includeLandmarkletcurrent_id=refThread.(id(self()))letcheck()=!current_id=Thread.(id(self()))leterroroperation=failwith(Printf.sprintf"%s: this operation can only be called by the thread that started the profiling"operation)letincrement?timescounter=ifcheck()thenincrement?timescounterletsamplesamplervalue=ifcheck()thensamplesamplervalueletenterlm=ifcheck()thenenterlmletexitlm=ifcheck()thenexitlmletwraplmfx=ifcheck()thenwraplmfxelsefxletunsafe_wraplmfx=ifcheck()thenwraplmfxelsefxletexport?label()=ifcheck()thenexport?label()elseerror"export"letreset()=ifcheck()thenreset()elseerror"reset"letexport_and_reset?label()=ifcheck()thenexport_and_reset?label()elseerror"export_and_reset"letstart_profiling?profiling_options()=current_id:=Thread.(id(self()));start_profiling?profiling_options()letstop_profiling()=stop_profiling()