If you need that this process must be executed always, you have to run it in background (&) in your system.
And yes, the best way is doing an infinite looping with a pause.
while(1) {
....
usleep(500000);
}
Note: usleep() works with microseconds, so 1 second = 1000000 micro seconds.