What determines how long adjudication will take?

I was sponsored by my first company in June 2017 and wasn’t cleared until July 2019. Literally waiting for almost 6 months before I received a phone call from anyone. Once I met with my investigator she was really surprised about how long I had been waiting to be interviewed. Luckily I still had a full time job that point but it’s a grueling process for some. I basically gave up at a point assuming that it was never going to happen. One of my contractors had turnover in July 2019 and by a stroke of luck that’s exactly when my TS was approved and I got a awesome job about 2 weeks later. Hang in there man it will happen.