Is time measurement available in device function?

I want to check device function execution time in global function.
How to do this?

You can use the clock() intrinsic, which is a cycle counter.