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

  • Home
  • SEARCH
  • 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 7705213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:49:23+00:00 2026-05-31T23:49:23+00:00

In relation to: Big-O of .GetProperties() How many nanoseconds does the .GetProperties() method take

  • 0

In relation to: Big-O of .GetProperties()

How many nanoseconds does the .GetProperties() method take in C#?

EDIT

Tested:

On simple dev computer (nothing fancy), item has 8 properties, and no inheritance:

        stopwatch.Start();
        for (int i = 0; i < 10000; i++)
        {
            PropertyInfo[] properties = item.GetType().GetProperties();
        }
        stopwatch.Stop();

Results:

  • Total Time in Nanoseconds: 16,569.8
  • Total Time in Milliseconds: 16.5698
  • Average Time Per .GetProperties() Call: 1.65 ns (This is an assumption, not sure if the results are being cached)

    Moreover

    When ran a second time with an extra nested foreach loop this only took a total of 6 milliseconds. Here is the added code (inside the for loop):

                foreach (var prop in properties)
                {
                    var x = prop;
                }
    
    • 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-31T23:49:23+00:00Added an answer on May 31, 2026 at 11:49 pm

      Given your complete application code, a complete description of your hardware, your registry or system configuration, your operating system version, and a list of all running software and their activities, it should be possible to come up with a reasonable guess.

      What I am trying to say is that it depends. On almost everything. The only way to find out is to time it, preferably with a Stopwatch and over many iterations. The exact result varies from time to time, and is mostly dependent on the class that you are examining, the amount of CPU power available, and luck (aka processor scheduling).

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

    Sidebar

    Related Questions

    My question is in relation this this answer. https://stackoverflow.com/a/8773953/1297775 I have read at many
    I'm solving some recurrence relation problems for Big O and so far up till
    I am trying to find the big O bound for the following recurrence relation:
    so I have this big method in my application for newsletter distribution. Method is
    This problem is very simple i think... I dont have experience with big scalable
    I am learning django admin, i have to models with a one-to-many relation between
    Maybe something really simple, I got really big problem with... ORM result. I'm loading
    Lets say I have two tables - child and parent with many-to-one relation. What
    Relation between idc=courseID HTML of Grid view <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False DataKeyNames=id DataSourceID=EntityDataSource1> <Columns>
    In relation to my question here , I have a plot for which the

    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.