Skip to content

Commit

Permalink
Fix Benchmark.ms deprecation warning on Rails 8 (#123)
Browse files Browse the repository at this point in the history
This fixes the following deprecation warning:

> `Benchmark.ms` is deprecated and will be removed in Rails 8.1 without
replacement.
  • Loading branch information
mattbrictson authored Sep 29, 2024
1 parent a0081da commit 6d7f80a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions template/test/vite_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
return if ViteRuby.config.auto_build

# Compile assets once at the start of testing
millis = Benchmark.ms { ViteRuby.commands.build }
puts format("Built Vite assets (%.1fms)", millis)
require "benchmark"
seconds = Benchmark.realtime { ViteRuby.commands.build }
puts format("Built Vite assets (%.1fms)", seconds * 1_000)

0 comments on commit 6d7f80a

Please sign in to comment.