Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

How accurate are timers?

Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
I was looking into using startTimer() and printTimer() in a feature, and realized I could call them in separate features, which could be a great way to profile my feature tree with more detail than the "Regeneration times" panel, since I could "start" and "check" my timers to evaluate sections of the tree. In some preliminary testing it seems like the values I'm getting from printTimer() are a lot different than the regen times though. Can someone explain why?

Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io

Best Answer

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,178
    Answer ✓
    Yeah, startTimer and printTimer don't work when they're in different features because they're measuring wall clock time, and we don't always regenerate from the beginning.  What happened was you edited some feature in the middle and we regenerated starting from that point some time later, and printTimer printed the time elapsed since the start of the previous regeneration.  What are you trying to do?
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc

Answers

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,178
    Answer ✓
    Yeah, startTimer and printTimer don't work when they're in different features because they're measuring wall clock time, and we don't always regenerate from the beginning.  What happened was you edited some feature in the middle and we regenerated starting from that point some time later, and printTimer printed the time elapsed since the start of the previous regeneration.  What are you trying to do?
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Options
    Evan_ReeseEvan_Reese Member Posts: 2,066 PRO
    Ah okay this isn't likely to work as well then. I was seeing if it might be possible to make a Feature Timer feature so I could get more granular Regen data about my model. This would especially help to profile a part studio when it's not one egregiously large whale of feature bogging it down, but instead a bunch of little piranhas that don't rank high on the Regen list individually, but still add up to a lot, like a folder with 20 fillet features.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Options
    MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,034 EDU
    @Evan_Reese
    One way you might be able to work around it is to force a full regeneration (make an empty sketch or some other feature and drag it up to the top of the feature tree).
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
Sign In or Register to comment.