I am currenctly stuck, the answer is probably somewhere on google but I don't know what word to use this time so I hope someone can help me here.
I have a list of element and I want to apply a fuction to each element but I want to wait between each elements.
I have something like that for now :
val numbers = List(10, 11, 12,13,14)
numbers.foreach(i => {
//do some stuff with i
Thread.sleep(1000)
})
but I don't think it's proper way to do it. Maybe there is a way that do not block everything?