I have a function called read() that interacts with some hardware and sometimes it returns the value very quickly and other times it could be very slow. I would like to have a timeout associated with my function read() so that if it takes over maybe a second then the function will timeout. I see people talking about using Boost or multi threading and am not too familiar with either. Can someone help me with this? Thanks.
Niner710 0 Light Poster
Radical Edward 301 Posting Pro
Niner710 0 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Niner710 0 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Niner710 0 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
nbaztec 45 Posting Pro in Training
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
nbaztec 45 Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.