# Alternative to && separation in step definitions to get fine-grained timing information

**URL:** https://forum.buildkite.community/t/alternative-to-separation-in-step-definitions-to-get-fine-grained-timing-information/2491
**Category:** General
**Created:** [December 30, 2022, 9:41am UTC](https://forum.buildkite.community/t/alternative-to-separation-in-step-definitions-to-get-fine-grained-timing-information/2491 "2022-12-30T09:41:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![paul\_h](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@paul\_h](https://forum.buildkite.community/u/paul_h)
#### Post date: [December 30, 2022, 9:41am UTC](https://forum.buildkite.community/t/alternative-to-separation-in-step-definitions-to-get-fine-grained-timing-information/2491/1 "2022-12-30T09:41:44Z")

</div>

```auto
steps:
  - command: "npm install && npx nx run-many --target=test --all"

```

How do I get timing information in the build result for each of `npm install` and the test invocation (to the right of the &&)?

Alternatively, is there an alternate non-&& way of making the two command run one after the other on the same build agent without resetting working copy between the two with a git-checkout?

---

<div class="post-metadata">

### Author: ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)
#### Post date: [December 30, 2022, 2:38pm UTC](https://forum.buildkite.community/t/alternative-to-separation-in-step-definitions-to-get-fine-grained-timing-information/2491/2 "2022-12-30T14:38:05Z")

</div>

Hey @paul_h! 👋

The timing displayed is for the whole command, but you can work on a workaround creating new [group outputs](https://buildkite.com/docs/pipelines/managing-log-output).  
You can use a script with the commands (which is nicer), or have something like:

```auto
steps:
  - command: echo "--- npm" && npm install && echo "--- tests" && npx nx run-many --target=test --all

```

> [@paul\_h](#):
>
> is there an alternate non-&& way of making the two command run one after the other on the same build agent

Instead of using a single line of commands, you can pass a list of commands that must all pass:

```auto
steps:
  - commands:
    - "npm install && npm test"
    - "moretests.sh"
    - "build.sh"

```

More info at [Command step | Buildkite Documentation](https://buildkite.com/docs/pipelines/command-step#command-step-attributes)

Best!

---

<div class="post-metadata">

### Author: ![paul\_h](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@paul\_h](https://forum.buildkite.community/u/paul_h)
#### Post date: [January 1, 2023, 12:12pm UTC](https://forum.buildkite.community/t/alternative-to-separation-in-step-definitions-to-get-fine-grained-timing-information/2491/3 "2023-01-01T12:12:05Z")

</div>

echo "— some term to mark a break in the current build step

^ that’s a great trick, thanks.
