Skip to content

Commit

Permalink
Monotonic clock
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Mar 28, 2024
1 parent 85db712 commit e71d9c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/controllers/mpa_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MpaController < HandleOptionsController
skip_before_action :verify_authenticity_token, raise: false

def get_time
Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)
Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
end

def pept2data
Expand All @@ -28,9 +28,8 @@ def pept2data
database_time = 0
aggregation_time = 0
lineage_time = 0
prepare_lineage_time = 0

starting_total_time = get_time
start_total_time = get_time

peptides.each_slice(50) do |peptide_slice|
# Convert the peptide_slice array into a JSON string
Expand Down Expand Up @@ -122,7 +121,7 @@ def pept2data
@timings["aggregation_time"] = aggregation_time / 1000
@timings["lineage_time"] = lineage_time / 1000
@timings["prepare_lineage_time"] = prepare_lineage_time / 1000
@timings["total_time"] = get_time - starting_total_time / 1000
@timings["total_time"] = get_time - start_total_time / 1000
end

def pept2filtered
Expand Down

0 comments on commit e71d9c6

Please sign in to comment.