function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kallam salesforce1kallam salesforce1 

What is CPU time error and how to avoid this? I faced Same question on Batch and Trigger as well. Can you please explain this concept

Best Answer chosen by kallam salesforce1
Sai PraveenSai Praveen (Salesforce Developers) 
Hi kallam,

This is one of the Governer limit of the salesforce. Salesforce limits CPU usage to 10 seconds for synchronous transactions . So if your transaction takes more than that particular time this error occurs . There may be many reasons for getting this error. 

Please find the below article which explains clearly on this isus.

https://lanefour.com/salesforce-admin/apex-cpu-time-limit-exceeded/#:~:text=What%20is%20a%20CPU%20timeout,and%20can't%20be%20completed. (https://lanefour.com/salesforce-admin/apex-cpu-time-limit-exceeded/#:~:text=What%20is%20a%20CPU%20timeout,and%20can't%20be%20completed.)

If this solution helps, Please mark it as best answer.

Thanks,