Runtime in C programs

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

Replies

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"

Hi eskimo,


first of all, sorry for my late response.


you hit the point. That was exactly that I was looking for.

Now it's working!


I wish you a great day.


Greetings from Europe.


CX8060