for it to be accurate you should set an alarm and wake up at the same time everyday and test then you can go back to sleep or whatever you want.
You can do it with waking up a different times as long as you had 3 good hours of sleep, but it may not be as accurate. If you wake up within like an hour of the usual time it shouldn't make much of a difference, but several hours probably will.