clock() returns not the elapsed time (wall clock time), but the processor time; that is, the amount of time that the process has spent actually performing computation of some sort. Waiting on I/O doesn't count. Sleeping (more precisely, sleep()ing) doesn't count either.
That's why you probably got a duration of 0 seconds.
If you want a simple measure of elapsed time, see:
If you want something almost as simple but more precise, see:
Hope this helps.