Welcome in the forum, BB.
Since you do not have an OS on a PSoC the gettimeofday() will not work as you expect. Think about using the RTC component.
On the other hand, there is already a CyDelayUs() API. Check the "System Reference Guide" (from Creator -> Help).
Thanks for the quick reply. Makes sense. I didn't know if the PSoC maybe did some tricks to make functions like that work. And thanks for the tip on the CyDelayUs(). I'm still kicking the tires on this thing and getting an idea of how it behaves.
Just in a few sentences: PSoCs consist of an ARM processor with moderate speed, flash and sram and real routable internal hardware.
With that hardware a handful (PSoC5: more than 100) of components are built that can be put onto a schematic and routed as required.
When using PSoCs with internal UDBs (Universal Digital Block) you even might use a hardware definition language (Verilog) to build your own hardware components. There are analog components as opamps, ADCs, DACs, comparators, S&Hs, analog MUXes. There are digital ORs, ANDs, NOTs and whatever you need. Use them, think PSoC. There are a couple of video tutorials that will help you starting off. Get hands on one (or two) of the prototyping kits for PSoC4 or even better the PSoC5.