But that's still not fast enough. It's evil! I am trying to figure out to even get a functioning code to do what I wanted it to do. I think you should change it to isPrime and then reverse the sense of it. I wasn't ignoring you. I was given partial code from my teacher that was written that way, which is the only reason I am even using isPrime I assume my teacher put it in there for a reason.
Your code as is returns 11, the 5th prime.
I don't think temp is a very good name. This reduces the problem by a factor of N, where N is the number of primes you were asked to find. This goes for both loops. It would be more clear to just say return instead of break.
A smart compiler will optimize this for you, but you can't always depend on your compiler being that smart. But for the purposes of your online problem, I'm sure that the key factor was to use a one pass solution instead of an N pass solution.
Instead of iterating through all integers, you can only iterate through all odd integers. It isn't counting 2 as a prime number, which I think I understand why now.