Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7735579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:32:13+00:00 2026-06-01T07:32:13+00:00

I am using boost::format variable to get elapsed time in seconds boost::posix_time::time_duration total_time =

  • 0

I am using boost::format variable to get elapsed time in seconds

boost::posix_time::time_duration  total_time = start_1.elapsed();
long milliseconds = total_time.total_milliseconds();
boost::format output("%.6f");
output % (milliseconds/1000.0);

But I use the timer several times to cumulate durations.
I want to know with which type of variable can I cumulate durations ( use the operator +). For example with a float by I don’t know how to convert from boost::format to float

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:32:14+00:00Added an answer on June 1, 2026 at 7:32 am

    According to the documentation documentation, time_duration has operator +. So it is possible to use time_duration itself to accumulate durations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using boost::posix_time::ptime to measure my simulation run-time and for something else. assuimg
How can i create a boost::format type formatter object using the character-string or std::string
I'am using boost date time to calculate the unix time for a particular date.
Follow-up to post: Using * Width & Precision Specifiers With boost::format I'm trying to
Using boost::program_options, I can not get my own option type to compile when it
I am trying to format a string using boost: wchar_t *msg; // fill msg
I was wondering whether Boost.Format does support using a fixed-width / preallocated buffer as
i am using a boost::array which has the format < char, const std::size_t >
I'm trying to print a boost::posix_time::ptime in the format of YYYY-MM-DD hh:mm:ss.fff where the
I have a string of format [id1,id2,id3] . i'm using boost split to split

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.