Depends on what you mean by "idle time" exactly, but for a start, run
and check out the column named "idle". Not sure what you mean by "X-terminal session", but you can run this from a shell or terminal emulator within X..
Remember that if you check the idle time of the user you're checking it as, you'll reset the counter too (because you're typing and/or moving mouse when doing it).
EDIT: the above means of course the idle time of some user(s), not the "system" idle time. I'd say that's the best idle time you can get, because the system itself is hardly ever truly idle, except for when it's shut down; there are always some processes going on.