Profectus/src/components/system/TPS.vue

29 lines
504 B
Vue
Raw Normal View History

<template>
2021-06-13 22:16:38 -05:00
<div class="tpsDisplay" v-if="tps !== 'NaN'">
TPS: {{ tps }}
</div>
</template>
<script>
2021-06-13 22:16:38 -05:00
import Decimal, { formatWhole } from '../../util/bignum';
2021-07-24 17:08:52 -05:00
import player from '../../game/player';
export default {
name: 'TPS',
computed: {
tps() {
2021-06-13 22:16:38 -05:00
return formatWhole(Decimal.div(player.lastTenTicks.length, player.lastTenTicks.reduce((acc, curr) => acc + curr, 0)))
}
}
};
</script>
<style scoped>
.tpsDisplay {
position: absolute;
left: 10px;
bottom: 10px;
2021-05-22 15:29:06 -05:00
z-index: 100;
}
</style>