Skip to content

Conversation

@nawawi
Copy link
Contributor

@nawawi nawawi commented Sep 3, 2024

📚 Description

Fix: #318

bashunit will throw an error when Perl Time::Hires is not available. This requires a minor fix to the clock::now() function.

🔖 Changes

function clock::now() {
  if perl -MTime::HiRes -e "" > /dev/null 2>&1; then
    perl -MTime::HiRes -e 'printf("%.0f\n",Time::HiRes::time()*1000)'
  elif [[ "$_OS" != "OSX" ]]; then
    date +%s%N
  else
    echo ""
  fi
}

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

@rene-hermenau
Copy link

Nice! Thanks for the fix @nawawi Works for me!

Copy link
Member

@Chemaclass Chemaclass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many thanks!!

@Chemaclass Chemaclass added the bug Something isn't working label Sep 3, 2024
@Chemaclass Chemaclass merged commit 67a452a into TypedDevs:main Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't locate Time/HiRes.pm

6 participants