Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.
	Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
			
		
		
			- 
				
																			 kaveh1000
- Livecode Opensource Backer
  
- Posts: 539
- Joined: Sun Dec 18, 2011 7:23 pm
- 
				Contact:
				
			
						
						
													
							
						
									
						Post
					
								by kaveh1000 » Wed Feb 01, 2023 3:36 pm
			
			
			
			
			I have a stack with several scripts and many handlers. I want to track taken by each hander and functions in order to see where the bottlenecks are and make them more efficient. I now put these lines around each handler:
Code: Select all
   put the millisecs into ms
   answer the millisecs - ms
but it is labour intensive. Any way of tracking times taken by handlers without this method?. Thanks.
Kaveh
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 dunbarx
- VIP Livecode Opensource Backer
  
- Posts: 10392
- Joined: Wed May 06, 2009 2:28 pm
						
						
													
							
						
									
						Post
					
								by dunbarx » Wed Feb 01, 2023 4:13 pm
			
			
			
			
			Kaveh1000
I assume you meant something like:
Code: Select all
on mouseUp
  put the milliseconds into startTime
  doStuff
  answer the milliseconds - startTime
 end mouseUp
Gives the time to do "doStuff". But it is only two extra lines of code. Why do you think this is labor intensive?
Craig
 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 kaveh1000
- Livecode Opensource Backer
  
- Posts: 539
- Joined: Sun Dec 18, 2011 7:23 pm
- 
				Contact:
				
			
						
						
													
							
						
									
						Post
					
								by kaveh1000 » Wed Feb 01, 2023 4:25 pm
			
			
			
			
			Hi Craig
I have probably 100 or more handlers. Also each handler has other handlers and functions inside. So I am having to put these lines around each handler one by one. So was wondering any way of getting a list of every handler and the time it took to do its job!
Regards
Kaveh
			
			
									
									Kaveh
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 FourthWorld
- VIP Livecode Opensource Backer
  
- Posts: 10065
- Joined: Sat Apr 08, 2006 7:05 am
- 
				Contact:
				
			
						
						
													
							
						
									
						Post
					
								by FourthWorld » Wed Feb 01, 2023 4:48 pm
			
			
			
			
			4W Flight Recorder will give you relative times of everything triggered while it's monitoring.
You can get it from the Stacks section of LiveNet - in the IDE see Development -> Plugins -> GoLiveNet
			
			
									
									
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 mtalluto
- VIP Livecode Opensource Backer
  
- Posts: 128
- Joined: Tue Apr 11, 2006 7:02 pm
- 
				Contact:
				
			
						
						
													
							
						
									
						Post
					
								by mtalluto » Wed Feb 01, 2023 5:59 pm
			
			
			
			
			You can use the built in profiler. It works similarly to Richard’s flight recorder.
			
			
									
									
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 kaveh1000
- Livecode Opensource Backer
  
- Posts: 539
- Joined: Sun Dec 18, 2011 7:23 pm
- 
				Contact:
				
			
						
						
													
							
						
									
						Post
					
								by kaveh1000 » Wed Feb 01, 2023 6:03 pm
			
			
			
			
			Thanks Mark. Seems Profiler only in Business edition 

Kaveh
						 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 bn
- VIP Livecode Opensource Backer
  
- Posts: 4189
- Joined: Sun Jan 07, 2007 9:12 pm
						
						
													
							
						
									
						Post
					
								by bn » Wed Feb 01, 2023 7:37 pm
			
			
			
			
			kaveh1000 wrote: ↑Wed Feb 01, 2023 6:03 pm
Thanks Mark. Seems Profiler only in Business edition 
 
 
PowerDebug from Mark Wieder has a profiling option. Similar to the profiling of the business edition.
It is not free but it is a lifetime license.
https://www.ahsoftware.net/PowerTools/PowerDebug.lc
Kind regards
Bernd
 
		 
				
		
		 
	 
	
				
		
		
			- 
				
																			 kaveh1000
- Livecode Opensource Backer
  
- Posts: 539
- Joined: Sun Dec 18, 2011 7:23 pm
- 
				Contact:
				
			
						
						
													
							
						
									
						Post
					
								by kaveh1000 » Thu Feb 02, 2023 7:09 pm
			
			
			
			
			Thank you all. I had no idea about any of these tools. 

Kaveh