Cervical spondylosis can cause unconsciousness for some time is it ok?

No. You should be evaluated and imaging done to figure out the cause of losing consciousness. I deal with the neck every day as a spine surgeon and do not attribute falling unconscious with spondylosis or bone spurs of the cervical spine.
Check it out. You should get with your doc. Unexpected loss of conscious can be dangerous.