Indeed, after more test, it seems to be the real computation time.
So to summarize, the timer measures the time it takes to go through the model forward function, which lists the computation tasks from the model in the queue of the GPU. When the queue is full, the program wait for space in the queue, meaning that the timer measures now also the time needed for the queue to advance (i.e. that computation tasks listed in the queue are done). This final time measured is then much closer to the real computation time.
I post the final code example in case it could help someone. I didn’t find a lot of example for C++ and Qt, it might be a good start for other.
main.cpp:
#include <torch/torch.h>
#include <torch/script.h>
#include <QDebug>
#include <QElapsedTimer>

#include <cuda_runtime.h>

// Simple 5 linear layers network
struct NetImpl : torch::nn::Module {

    torch::nn::Linear linear_1;
    torch::nn::Linear linear_2;
    torch::nn::Linear linear_3;
    torch::nn::Linear linear_4;
    torch::nn::Linear linear_5;

    NetImpl(std::vector<int64_t> linear_dim_in, std::vector<int64_t> linear_dim_out)
      : linear_1(linear_dim_in[0], linear_dim_out[0]),
        linear_2(linear_dim_in[1], linear_dim_out[1]),
        linear_3(linear_dim_in[2], linear_dim_out[2]),
        linear_4(linear_dim_in[3], linear_dim_out[3]),
        linear_5(linear_dim_in[4], linear_dim_out[4])
    {
        register_module("linear_1", linear_1);
        register_module("linear_2", linear_2);
        register_module("linear_3", linear_3);
        register_module("linear_4", linear_4);
        register_module("linear_5", linear_5);
    }

    torch::Tensor forward(torch::Tensor x)
    {
        x = torch::flatten(x, 1, -1); // Flatten

        x = linear_1->forward(x);
        x = linear_2->forward(x);
        x = linear_3->forward(x);
        x = linear_4->forward(x);
        x = linear_5->forward(x);

        return x;
    }
};
TORCH_MODULE(Net); // creates module holder for NetImpl



int main()
{

    // Detect CUDA device
    torch::Device device("cpu");
    if (torch::cuda::is_available())
    {
        device = torch::Device("cuda:0");
    }

    // Declare network build variables
    std::vector<int64_t> linear_dim_in;
    linear_dim_in.push_back(72960);
    linear_dim_in.push_back(1024);
    linear_dim_in.push_back(512);
    linear_dim_in.push_back(256);
    linear_dim_in.push_back(128);

    std::vector<int64_t> linear_dim_out;
    linear_dim_out.push_back(1024);
    linear_dim_out.push_back(512);
    linear_dim_out.push_back(256);
    linear_dim_out.push_back(128);
    linear_dim_out.push_back(3);

    // Create network
    Net net(linear_dim_in, linear_dim_out);

    // Set the model in eval mode
    net->eval();

    // Set the device in GPU
    net->to(device);


    // Declare a Timer and the loop number
    QElapsedTimer timer;
    int loop_nbr = 100;

    {
        // Disable grads computation. If not, grad values accumulate in GPU memory.
        torch::NoGradGuard no_grad;

        // For loop_nbr times
        for (int i = 0; i <= loop_nbr; i++)
        {
            qDebug() << "\n" << "Loop nbr.: " << i;

            // Start timer
            timer.restart();

            // Declare a random input
            torch::Tensor X_batch = torch::rand({1,1,240,304}, device);

            // Show the elapsed time
            qDebug() << "T_tensorDeclaration: " << timer.nsecsElapsed() << "ns";

            // Run the model on the input data.
            torch::Tensor prediction = net->forward(X_batch);

            // Wait for the end of GPU computation
            cudaDeviceSynchronize();

            // Show the elapsed time
            qDebug() << "T_forward: " << timer.nsecsElapsed() << "ns";
        }
    }

    return 0;
}

project.pro:
QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

CONFIG += no_keywords

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += main.cpp

INCLUDEPATH += $$PWD/../../libtorch/include
DEPENDPATH += $$PWD/../../libtorch/include

INCLUDEPATH += $$PWD/../../libtorch/include/torch/csrc/api/include
DEPENDPATH += $$PWD/../../libtorch/include/torch/csrc/api/include

LIBS += -L$$PWD/../../libtorch/lib/ -ltorch -lc10 -lcudart