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 6059707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:44:30+00:00 2026-05-23T08:44:30+00:00

I´m converting a Linux Logger to work in windows. The logger prints with snprintf.

  • 0

I´m converting a Linux Logger to work in windows.
The logger prints with snprintf.
In linux, this logger output timeofday.tv_usec , that give something like this :

Jun 24 18:30:31-232928 test-transport...

In my windows version, using QueryPerformanceCounter, i generate results like this:

jun 24 23:54:18-866568508 test-transport....

In Linux, the uSeconds have exactly 6 digits, but this windows function generate 9 digits. How could i print only the 6 last digits ? Remember that this is a time critical code.

  • 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-05-23T08:44:31+00:00Added an answer on May 23, 2026 at 8:44 am

    Use the remainder of dividing the number by 10 to the power of the number of digits you want to preserve.

    In your case:

    num % 1000000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not that familiar with Linux so I'm having trouble converting the following command
Is something like the following possible in C on Linux platform: I have a
Can anyone suggest any open source linux program for converting .wav files to flash
Any one can help converting this php regex pattern to js compatible one? $delimiter
I am converting a c program into c++, and I encountered these error message:
I am working on building an embedded network appliance (linux based) and have come
I have ImageMagick installed on my CentOS linux server. I am trying to get
I have a program that generates and outputs a sequence of simple sample math
I was starting to play with cython on my windows xp machine configured with
I have an excel spreadsheet based on a pivot table that is periodically updated

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.