best times scoreboard

I have a question if there is someone so good and has a code to create
scoreboard with best times, I need this for a racing game to save the best time from a race that is sent at the very end to a specific table where, for example, there are 10 records and then just overwrite. Does anyone have something like that? I was looking on the internet but it’s hard to find something like this: /

An easy way would be to have a list of times. While the list isnt full use ListofTimes.add(new time)
once the list is full you can just iterate through the list and insert the time on the highscore list, then remove the 11th time