With FUSE API, is it possible to know that for how much time a file is opened. If yes, then which methods to implement.
Yes. You need to implement open and release, then use the fuse info structure (depending on your implementation) to correlate the two.