Hi, Joseph
There is a lot of GPIO access from userspace discussion in this community, you can search "GPIO" to get them, for example, I have this topic come out when doing the search "https://community.freescale.com/message/254497#254497", there is also document in linux DOC, Documentation/gpio.txt , you can also refer to it.
If they are all too complicated, you can also try a simple way to achieve your goal, there is a memtool in /unit_tests of our rootfs, you can use it to access almost all the register you want, so you can setup GPIO, and toggle it via access its register directly(generally, you only need to config a pin's IOMUX to GPIO, then set GPIO's direction and output value). For GPT, if you want to access directly instead of calling linux API to get the time you want, you can just read the GPT's CNT register to get what you want, its freq should be 3MHz, you can also test its freq with two read in a fixed time, such as read it via "/unit_tests/memtool 0x2098024", after 5 secs, read it again, then count its freq. Now, we know how to read the GPT counter and its freq, you can measure the execution times. The GPT is running counting up.