Hey, so I created a for loop in swift which adds values from 1 to 1000000 in an empty array and then I print the array. But for some reason it runs really slow. And if I do it until 100 it's fast. But still that's the slowest I have seen-in other programming languages it's instant. Is it that Swift is slower or do I have to use some library I am not using?
Swift for loop runs slow
Do you do it in playground ? In app ?
You add values: do you mean append to the array ?
It wouyld help if you showed your code…
It’s probably best if you continue your conversation on Swift Forums.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I posted in Swift forums. Turns out it was because it's.a Playground app so that's solved.