Js map function halt

JS. How can i stop array.map() cycle?
I do time statistic. Need stop, if cycle in function get too lot time to work (500ms). I need use map, because need similar with code another page. Other function can change too other times for smaller maps. Or, i can wait 18s to complete :slight_smile: