Normally you would be able to use statvfs or pathconf, but they don't seem to support any way to find out that piece of information.
Apparently such a feature is being discussed for a future POSIX standard
we will also file some aardvarks for a pathconf enhancement
to return the granularity of timestamps on a per path basis.
Unfortunately, I can't see any clean way to do that today, not even in an OS-specific manner.
Any approach that tries to build a list of file systems and whether it supports sub-second resolution is dangerous. For example,
ext4 seems to support nanosecond resolution if the inodes are 256 bytes, but not if they are 128 bytes.
Compiling a comprehensive and accurate list would be hard, may require root access, and it might change tomorrow. Which sounds harder than just running
stat a few times to me.