[SalesForce] CPU Limit Exceed Issue

I am literally done everything for this.
Actually, I have created a Process builder on the Account which has created a Contact related to that Account whenever we create an Account.
When I am inserting 5000 accounts by execute anonymous window it is not executed and showing below error.
Can anyone please help me with this, It will be really helpful for me. Thanks!

"FATAL_ERROR|System.DmlException: Insert failed. First exception on row 2400; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Contact related Account” process failed. Give your Salesforce admin these details. Limit Exceeded
You or your organization has exceeded the maximum limit for this feature. Error ID: 1930279826-405699 (-1741830137)nization has exceeded the maximum limit for this feature. Error ID: 1930279826-405699 (-1741830137): []"

public class BulkAccountCreation {
    public static void method(){
        List <Account> accList = new List <Account>();
        for(Integer i = 0;i<5000;i++){
            Account acc = new Account ();
            acc.Name = 'Takashi';
            accList.add(acc);
        }
        insert accList;
        for(Account account:accList){
            System.debug('Account Name:::'+account.Name);
            System.debug('Contact Name:::'+account.contacts);
        }
    }
}

enter image description here

enter image description here

Best Answer

It has been solved. I used batch class for this and it worked for me.

global class BulkAccountCreation implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
        String query = 'SELECT Id,Name FROM Account';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext BC,List<Account> scope) {
        
        List <Account> accList = new List <Account>();
        for(Integer i = 0;i<5000;i++){
            Account acc = new Account ();
            acc.Name = 'Takeshi';
            accList.add(acc);
        }
        insert accList;
        for(Account account:accList){
            System.debug('Account Name:::'+account.Name);
            System.debug('Contact Name:::'+account.contacts);
        }
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}

Invoking Batch class -

BulkAccountCreation myBatchObject = new BulkAccountCreation();
Id batchId = Database.executeBatch(myBatchObject);
AsyncApexJob job = [SELECT Id, Status, JobItemsProcessed, TotalJobItems, NumberOfErrors FROM AsyncApexJob WHERE ID = :batchId ];

Thanks Derek F and sfdcfox for your quick responses.