In English, "barely"/"hardly" can be used both with a connection to time ("just finished"):
I had barely finished eating when he arrived. (食べたばかり...)
or to express the idea that a goal was reached at great effort, sometimes against expectations:
We barely made it alive.
There was so much wind, I could barely move forward.
I can hardly explain it myself.
The former (time-related) can generally be translated well with words like ばかり/ばっかり. There are also a few expressions such as ギリギリ or やっとこ, that can express both shortness of time and "difficulty", but building them in the above sentences would be slightly unnatural.
Beside these, is there a more idiomatic way to unambiguously translate that "can do with difficulty"/"nearly couldn't do it, but still managed" adverbial meaning in sentences like the ones above?