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

Is there option to increase CPU time limit

I have a scenario where too many calculations to be done with large volume of data to load a custom visualforce page report. I have almost avoided unnecessary loop in Apex code. Since it is more than 100k records, calculation is taking long time which is exceeding limit of 10000ms. So it is hitting CPU Limit Exceeded error. Is there a way to increase CPU time?
Rodolfo CalvoRodolfo Calvo
Sure, you can use a UBS flash drive - properties - use as - enable readyBoost
There is a pilot program available to increase the CPU time doube or tripled in future methods. Check this
nagachandra knnagachandra kn
Hi ,

In case if your still stuck with this. you can try to use @future to avoid the errors as future methods has 60kms time limit.
Sumit Kumar Singh 9Sumit Kumar Singh 9

Hi perumalvps, 
I am afraid that you can't use Future Method on VisualForce Pages. You will have to go for other workaround for this. One could be (As I don't know the whole scenario) - 
You should do all the calculations in Future Mehod or Batch and put the necessary information in a custom Object. Once the batch is finished you can send an email that report is ready now.
On the Visualforce page you can have a button something like "Run Report now". While the batch runs you can disable the button. You can also have a Field on the Visualforce page that will show when the report was run last time. 
I know it's a painful way, but it may help you. 

Sumit Kumar Singh
Hey you can use 
@future method this method is fired when sources are available or your process is much longer 
Thank You