How to convert two arrays into a key-value pair in ReactJS and show highest running times as percentage?

I have two arrays

const process = [
  "Code",
  "TextInputHost",
  "chrome",
  "MongoDBCompass",
  "ProductivePeak",
  "slack",
  "CalculatorApp",
  "ApplicationFrameHost",
  "PostmanCanary"
];

const runningTimes = [
  "3:30:13.215083",
  "10:02:54.742036",
  "199:05:16.214286",
  "233:50:56.012267",
  "175:53:23.705989",
  "124:36:21.385961",
  "103:10:26.574467",
  "231:39:22.576285",
  "1:32:4.394013"
];

I want to convert it into key-value pair in react js. I need the combinedObject to result as the 5 processes with the highest runningTime to be shown as the first five key value pair of combinedobject and remaining process should be shown in as the others key in the object with the value of all the remaining runningTime. and the resulting combinedobject should have the runningtime in percentage.

something the combinedobject should look like this:-
//here the highest runningTime of the process is MongodbCompass with 233 hours and applicationframeHost has second hightest of 231 hours which needs to be shown like this:-

{
  MongoDBCompass: 20%,
  ApplicationFrameHost: 19%,
  chrome: 15%,
  ProductivePeak: 9%,
  CalculatorApp: 5%,
  others: 32% 
} 

//Here all the remaining runningTimes are added and converted to percentage in the others

I tried a lot but couldn’t find the solution…
The code which I tried is

const calculateProcessPercentages = (processes, runningTimes) => {
   console.log(processes, runningTimes)
    const processData = {};
    let totalRunningTime = 0;

    // Step 1: Populate the object with process names and running times
    for (let i = 0; i < processes.length; i++) {
      const process = processes[i];
      const runningTime = runningTimes[i];

      processData[process] = parseTime(runningTime);
      totalRunningTime += parseTime(runningTime);
    }

    // Step 2: Sort the processes based on running time in descending order
    const sortedProcesses = processes.sort(
      (a, b) => {
          // console.log(processData[a], a, processData[b], b)
        return processData[b] - processData[a]}
    );

    // console.log(sortedProcesses);

    const result = {};

    // Step 3: Calculate percentages for the top 5 processes or applications
    let totalApplications = 0;
    let othersRunningTime = 0;

    for (let i = 0; i < sortedProcesses.length; i++) {
      const process = sortedProcesses[i];
      const runningTime = processData[process];

      if (totalApplications < 5) {
        const percentage = ((runningTime / totalRunningTime) * 100).toFixed(2);
        result[process] = `${percentage}`;
        totalApplications++;
      } else {
        othersRunningTime += runningTime;
      }
    }

    // Step 4: Calculate percentage for the "others" category
    if (othersRunningTime > 0) {
      const othersPercentage = (
        (othersRunningTime / totalRunningTime) *
        100
      ).toFixed(2);
      result["others"] = `${othersPercentage}`;
    }

    return result;
  };

  // Helper function to parse time in HH:MM:SS format and convert it to seconds
  const parseTime = (time) => {
    const [hours, minutes, seconds] = time.split(":");
    return (
      parseInt(hours) * 3600 + parseInt(minutes) * 60 + parseFloat(seconds)
    );
  };

It didn’t help me out….
Can someone help me out to solve this problem here……..
And the another problem with this here is with the sorting which is not working properly.
When I console log the combined object The sorting of the object goes wrong.