How to get an avrage of a time in an inline dataviewjs

I’m trying to do

I am currently trying to get the avrage of a set of times based off of string inputted time componets as obsidian doesnt have a time feature. these are more testing. some fields are not populated as they are not needed for the test.

Things I have tried

i currently have

The avrage time is $=dv.span(dv.pages('"Randos"').where(p=>p.game?.includes("AHIT")).where(p=>p.type?.includes("Multiplayer")).where(p=>p.Completed).time.avg()) which gives NAN (to be expected when trying to avrage 2 strings). removing the .avg() gives me 2 times in string format. i do not know how to convert said string times into intigers and then back into a time format in an inline way.

current results
image
with .avg()
image
without .avg()

the users on the discord helped me out a whole lot with this.

the ending result is a mess but most of that is just not the best naming scheme and it being inline. as its personal and i wolnt see the code i dont mind that much but just in case ill post the code here normal and with it being removed from being inline

the code is $=let times = dv.pages('"Randos"').where(p=>p.game?.includes("AHIT")).where(p=>p.type?.includes("Multiplayer")).where(p=>p.Completed).time;let workingtimes=[] ;for(let i = 0; i < times.length; i++){let splittime= times[i].split(":"); let rejoinedtime=splittime[0]+ " h , "+ splittime[1] + " m , "+ splittime[2]+ " s "; workingtimes[i] = parseInt(dv.func.durationformat(dv.func.dur(rejoinedtime), "s" ))}; const sum= workingtimes.reduce((acc,curval)=>acc+curval); let avrg=sum/workingtimes.length; let avragetimeseconds = avrg.toString() + " s "; let semiproperformatavg= dv.func.durationformat(dv.func.dur(avragetimeseconds), "hh mm ss");let properformatavg = semiproperformatavg.replaceAll(" ", ":"); properformatavg Normal code

remove comments (//) and get it back to one line

let times = dv.pages('"WhereToLook"').where(p=>p.PropertyName?.includes("PropertyFilling")).PropertyThatHoldsTimes; //this will create the array of times replace WhereToLook to the folder to look for is. PropertyName replace with the name of the property for filtering or remove the whole "where" block if you dont want any filtering in that folder. replace PropertyThatHoldsTimes with the name of the property that holds the time
let workingtimes=[] ; //creates the variable that holds all of the times that we work in
for(let i = 0; i < times.length; i++){let splittime= times[i].split(":"); let rejoinedtime=splittime[0]+ " h , "+ splittime[1] + " m , "+ splittime[2]+ " s "; workingtimes[i] = parseInt(dv.func.durationformat(dv.func.dur(rejoinedtime), "s" ))}; //this chunk of code first makes a variable that holds a splited version of the times into 3 groups (these being HH, MM, SS) and splits them. then adds h , m , s based off of the [dv.func.dur()](https://blacksmithgu.github.io/obsidian-dataview/reference/functions/#durationformatduration-string). if you are only working with hours and minuts remove the set that holds the seconds aswell as the comma befor the minuts (, "+ splittime[2]+ " s) lastly it will add the entry into the current indexed working time as a int based off of the format durrationformat gives it (seconds) 
const sum= workingtimes.reduce((acc,curval)=>acc+curval); //adds all the entrys of workingtimes together
let avrg=sum/workingtimes.length; //avrages it by deviding the sum by the length
let avragetimeseconds = avrg.toString() + " s "; //turns it into a string
let semiproperformatavg= dv.func.durationformat(dv.func.dur(avragetimeseconds), "hh mm ss"); // reformats it to hours minuts and seconds
let properformatavg = semiproperformatavg.replaceAll(" ", ":"); //then creates it back into the same format as it started
properformatavg //this just shows it inline

it is jank but it works and i hope this helps atleast somewhat