5

I have a very long loop that takes forever in playground because of the constant output. Is there a way to disable output for certain lines of code? I still want the whole thing to run, I just don't want to wait forever to see the result.

FYI - I know I can run the code on demand but that doesn't matter . It still takes forever. I don't mind it running continuously, I just want it to run without all of the output.

FYI - I also know that playground is not used for performance. I just don't want to wait forever to see a result. I'm not testing performance.

JAL
  • 41,701
  • 23
  • 172
  • 300

1 Answers1

1

This question was answered in this post.

To summarize the portion relevant to your question: wrapping your code in a tuple will prevent it from having output in Xcode Playgrounds and speed up execution time.

For example:

input: var x = 10 // output: 10
input: (var x = 10) // output: None
rikitikitavi
  • 139
  • 13