Skip to content

Logged query execution time is misleading ("Executed in: ...ms") #16

@circulon

Description

@circulon

Migrated from: MasoniteFramework/orm#945
Original author: @PrinceBlueberry
Originally opened: 2025-11-27
Original state: closed


Description
When logging queries, the execution time is misleading because it has the wrong units.

To Reproduce

  1. Ensure log_queries is set to True.
  2. Execute a query that takes approximately one second to complete.
  3. Look at the logs, see something like: "Executed in 1.23ms"

Expected behavior
Should report the runtime with the correct unit (I propose seconds instead of milliseconds).

Screenshots or code snippets
N/A

Desktop (please complete the following information):

  • Windows 11
  • Debian GNU/Linux 11 (bullseye)

What database are you using?

  • Type: SQLite
  • Version 3.34.1 (inside docker)
  • Masonite ORM v2.23.2

Additional context
In the source code, the underlying timer is timeit's default_timer, which the docs say will return floating point seconds (not milliseconds as is currently annotated by masonite).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions