2 Replies
      Latest reply on Sep 11, 2019 10:55 AM by CX8060
      CX8060 Level 1 Level 1 (0 points)

        Hello together,

         

        In our computer engineering course at university we talk about parallelizing C programs. So, I want to try the examples for myself in Xcode.

        Does anyone know whether there is a possibility to see the runtime of a C program in Xcode?

         

        Thank you very much in advance and have a great sunday!

         

        CX8060

        • Re: Runtime in C programs
          eskimo Apple Staff Apple Staff (12,045 points)

          Does anyone know whether there is a possibility to see the runtime of a C program in Xcode?

          I’m not sure what you’re asking for here.  My best guess is that you’re trying to time how long a program takes to run.  If so, there’s a bunch of different approaches you can take, but three common ones are:

          • Run the program using the time command; see its man page for more.

          • Time the critical code programmatically by taking a timestamp at the start and a timestamp at the end and diffing them.

          • Use Xcode’s test infrastructure, which supports performance testing.  You can learn more about this in the Xcode help.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"